/* -----------------------------
   Design System (Ultra-Professional)
-------------------------------- */
:root {
    /* Colors - Sophisticated Monochromatic Slate */
    --bg: #0a0a0c;
    --bg-subtle: #111114;
    --text: #ecedee;
    --text-muted: #9ba1a6;
    --text-dim: #70757a;

    --brand: #ffffff;
    /* Use white/black as base for ultra-pro look */
    --brand-muted: rgba(255, 255, 255, 0.1);
    --accent: #3b82f6;
    /* Single punchy primary for contrast */

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    --glass: rgba(17, 17, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);

    --radius: 8px;
    /* Sharper corners for a more precise, technical feel */
    --radius-lg: 12px;
    --max: 1280px;

    --font-serif: 'Instrument Serif', serif;
    --font-sans: 'Inter', sans-serif;

    --grid-gap: 1.5rem;

    /* Spacing Scale (0.25rem = 4px increments) */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-7: 1.75rem;
    /* 28px */
    --space-8: 2rem;
    /* 32px */
    --space-10: 2.5rem;
    /* 40px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */

    /* Typography Scale */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-subtle: #f9fafb;
    --text: #111827;
    --text-muted: #4b5563;
    --text-dim: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
}

/* -----------------------------
   Base Styles
-------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 255, 255, 0.01) 0px, transparent 50%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.01em;
}

p {
    font-size: 1.05rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

.container {
    width: min(var(--max), calc(100% - 64px));
    margin: 0 auto;
}

/* -----------------------------
   Typography Utils
-------------------------------- */
.label {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

/* Utility Classes */
.hero-btn {
    padding: var(--space-4) var(--space-10);
    font-size: var(--text-base);
}

.card-accent {
    background: var(--accent) !important;
    color: white !important;
}

.card-accent .label {
    color: rgba(255, 255, 255, 0.7) !important;
}

.card-accent h3 {
    color: white !important;
    margin-bottom: var(--space-4);
}

.card-accent p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
}

.divider-top {
    margin-top: var(--space-6);
    border-top: 1px solid var(--border);
    padding-top: var(--space-6);
}

.profile-compact {
    padding: var(--space-6);
}

.profile-img-sm {
    margin-bottom: var(--space-4);
    width: 60px;
    height: 60px;
}

.heading-compact {
    font-size: var(--text-xl);
}

.text-compact {
    font-size: 0.85rem;
}

.footer-style {
    padding: var(--space-20) 0;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: var(--text-2xl);
    letter-spacing: -0.04em;
}

.footer-text {
    color: var(--text-dim);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.drawer-close {
    position: absolute;
    top: var(--space-8);
    right: var(--space-8);
}

.form-compact {
    display: grid;
    gap: var(--space-6);
}

.card-padding-compact {
    padding: var(--space-8);
}

.section-spacing-sm {
    margin-top: var(--space-6);
}


/* -----------------------------
   Header
-------------------------------- */
.header {
    position: fixed;
    top: 1.5rem;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-pill {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand span {
    font-size: 1.25rem;
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
}

.drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 2000;
    padding: 2rem;
}

.drawer .menu {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.drawer .menu a {
    font-size: 1.5rem;
}

.menu {
    display: flex;
    gap: 1.5rem;
}

.menu a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.menu a:hover {
    color: var(--text);
}

.btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn.primary {
    background: var(--text);
    color: var(--bg);
}

.btn.primary:hover {
    background: #fff;
    transform: translateY(-1px);
}

.btn-theme {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.btn-theme:hover {
    color: var(--text);
}

/* -----------------------------
   Hero (Digital Editorial Style)
-------------------------------- */
.hero {
    padding: 10rem 0 5rem 0;
    text-align: center;
}

.hero .label {
    margin-bottom: 1.5rem;
    display: block;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 0.95;
    margin-bottom: 2rem;
}

.hero p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
    font-size: 1.25rem;
    line-height: 1.4;
}

/* -----------------------------
   Bento Grid Layout
-------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--grid-gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: var(--grid-gap);
    margin-top: 2rem;
}

.bento-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
    height: 100%;
    position: relative;
}

.bento-card:hover {
    border-color: var(--border-strong);
}

.card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.card-medium {
    grid-column: span 2;
}

/* Profile Styles */
.profile {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.profile-info {
    flex-grow: 1;
}

.scholar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 1rem;
    font-weight: 500;
}

.responsibility-tag {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.35rem 0.7rem;
    border-radius: 99px;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: auto;
    width: fit-content;
}

.status-badge.wip {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.card-wip {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02), rgba(16, 185, 129, 0.06)) !important;
    border-color: rgba(16, 185, 129, 0.12) !important;
}

.card-wip:hover {
    border-color: rgba(16, 185, 129, 0.25) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.08) !important;
}

.scholar-link:hover {
    text-decoration: underline;
}

.bento-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.bento-card .role {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: block;
}

.bento-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Dual Column Card Layout */
.dual-deck {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.deck-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
}

.deck-item .label {
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.deck-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.deck-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Protocol / Ethics Styling */
.protocol-card {
    background: rgba(59, 130, 246, 0.03);
    border: 1px dashed var(--accent);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.protocol-card h4 {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protocol-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* -----------------------------
   Sections
-------------------------------- */
section {
    padding: 4.5rem 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.section-title h2 {
    font-size: 3.5rem;
}

/* -----------------------------
   Animations
-------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* -----------------------------
   Responsive
-------------------------------- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .container {
        width: calc(100% - 32px);
    }

    .nav-pill {
        width: calc(100% - 32px);
        justify-content: space-between;
        gap: 1rem;
    }

    .nav-pill .menu,
    .nav-pill .btn.primary,
    .nav-pill .btn-theme {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    /* Typography adjustments */
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Grid layouts */
    .grid-2,
    .grid-3,
    .grid-4,
    .dual-deck {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Override for inline 5-column grid */
    [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: 1fr !important;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .bento-card {
        padding: 1.5rem;
    }

    /* Cards */
    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Spacing optimization */
    section {
        padding: 3rem 0;
    }

    .hero {
        padding: 6rem 0 4rem 0;
    }

    /* Footer */
    .footer-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer-flex .menu {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Form improvements */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Touch target sizes */
    .menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .bento-card {
        padding: 1.25rem;
    }

    section {
        padding: 2.5rem 0;
    }
}
