/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --color-primary: #4f46e5; /* Indigo 600 */
    --color-primary-hover: #4338ca; /* Indigo 700 */
    --color-bg-subtle: #f8fafc;
    --color-text-main: #0f172a;
    --color-text-muted: #64748b;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #818cf8; /* Indigo 400 */
        --color-primary-hover: #a5b4fc; /* Indigo 300 */
        --color-bg-subtle: #1e293b;
        --color-text-main: #f1f5f9;
        --color-text-muted: #94a3b8;
        --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    }
}

body {
    font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    letter-spacing: -0.025em; /* Tighter tracking for headings */
}

/* Premium Hero Section */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom right, rgba(79, 70, 229, 0.05), rgba(255, 255, 255, 0));
    border-radius: 1.5rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

@media (prefers-color-scheme: dark) {
    .hero-grid {
        background: linear-gradient(to bottom right, rgba(79, 70, 229, 0.1), rgba(15, 23, 42, 0));
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.w-full-span {
    grid-column: 1 / -1;
    width: 100%;
}

.profile-pic-container {
    width: 12rem;
    height: 12rem;
    margin: 0 auto;
    position: relative;
    flex-shrink: 0;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Fancy border */
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.05), 0 20px 40px -10px rgba(79, 70, 229, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
    .profile-img {
        border-color: rgba(30, 41, 59, 0.8);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    }
}

.profile-img:hover {
    transform: scale(1.05) rotate(2deg);
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.social-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.social-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: white;
    color: var(--color-text-main);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.social-link:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

@media (prefers-color-scheme: dark) {
    .social-link {
        background-color: #1e293b;
        border-color: rgba(255,255,255,0.05);
    }
    .social-link:hover {
        background-color: #2e3b4e;
        border-color: var(--color-primary);
    }
}

/* Glassmorphism Cards */
.latest-research-section {
    padding: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.75rem;
    background: linear-gradient(to right, var(--color-text-main), var(--color-text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    margin-bottom: 0;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

.pub-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pub-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    .pub-card {
        background: rgba(30, 41, 59, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.pub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary); /* Subtle border highlight */
}

/* Desktop Logic for Hero and Cards */
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: auto 1fr;
        gap: 3rem;
        text-align: left;
        padding: 1.5rem 4rem;
    }
    
    .hero-content {
        text-align: left;
        align-items: flex-start;
    }

    .social-flex {
        justify-content: flex-start;
    }
    
    .profile-pic-container {
        margin: 0;
    }
    
    .pub-card {
        flex-direction: row;
        align-items: flex-start;
    }

    .pub-year {
        text-align: center;
    }
}

.pub-year {
    font-size: 1.5rem;
    font-weight: 800;
    color: #cbd5e1;
    min-width: 5rem;
    flex-shrink: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
    .pub-year {
        color: #475569;
    }
}

.pub-card:hover .pub-year {
    color: var(--color-primary);
    opacity: 0.5;
}

.pub-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.pub-title a {
    color: var(--color-text-main);
    text-decoration: none;
    background-image: linear-gradient(var(--color-primary), var(--color-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
    padding-bottom: 2px;
}

.pub-card:hover .pub-title a {
    color: var(--color-primary);
    background-size: 100% 2px;
}

.pub-title a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.badge {
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    background-color: var(--color-bg-subtle);
    color: var(--color-text-muted);
    transition: all 0.2s;
}

.badge:hover {
    background-color: var(--color-primary);
    color: white;
}

.badge-pdf {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--color-primary);
}

.badge-pdf:hover {
    background-color: var(--color-primary);
    color: white;
}

/* Additional Layout Utilities */
.pub-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pub-journal {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.pub-links {
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.separator-container {
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    padding: 0 1rem;
}

.separator-gradient {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(79, 70, 229, 0.2), transparent);
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .separator-gradient {
        background: linear-gradient(to right, transparent, rgba(79, 70, 229, 0.4), transparent);
    }
}

/* Gradient Text Utility */
.gradient-text {
    background: linear-gradient(to right, var(--color-text-main), var(--color-text-muted), var(--color-text-main));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: gradient-flow 15s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Navigation Styling */
.brand-title {
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(to right, var(--color-text-main), var(--color-text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s;
    text-decoration: none;
}

.brand-title:hover {
    opacity: 0.8;
    text-decoration: none;
}

.name-link {
    text-decoration: none !important;
    transition: opacity 0.3s;
    display: block; /* Ensures proper hit area */
    border: none !important;
}

.name-link:hover {
    opacity: 0.8;
    text-decoration: none !important;
    border: none !important;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.3s;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* Article Content Headings */
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.article-content h2::before {
    content: '';
    display: block;
    width: 0.5rem;
    height: 1.5rem;
    background-color: var(--color-primary);
    border-radius: 9999px;
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

/* Also apply to direct h2 usage in templates */
.container h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.container h2::before {
    content: '';
    display: block;
    width: 0.5rem;
    height: 1.5rem;
    background-color: var(--color-primary);
    border-radius: 9999px;
}

/* Student List Grid */
.student-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 2rem; /* Vertical gap, Horizontal gap */
    margin-bottom: 2rem;
    align-items: baseline;
    font-size: 0.8rem;
}

.student-name {
    font-style: italic;
    color: var(--color-text-main);
    font-weight: 500;
}

.student-info {
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .student-grid {
        grid-template-columns: 1fr;
        gap: 0.25rem 0;
    }
    
    .student-name {
        margin-top: 0.75rem;
    }
    
    /* First item top margin reset */
    .student-name:first-child {
        margin-top: 0;
    }
}

