/* ==========================================================================
   CSS Variables & Theme
   ========================================================================== */

:root {
    /* Colors */
    --bg-primary: #09090b;
    --bg-secondary: #0f0f12;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #34d399;
    --accent-secondary: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #34d399, #22d3ee);
    --accent-dim: rgba(52, 211, 153, 0.1);
    --border: #27272a;
    --border-hover: #3f3f46;
    
    /* Typography */
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --max-width: 680px;
    --content-padding: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* ==========================================================================
   Layout
   ========================================================================== */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-4xl) var(--content-padding);
}

@media (max-width: 640px) {
    main {
        padding: var(--space-2xl) var(--content-padding);
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text-primary);
}

h2 {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

/* Status/Timeline metadata */
.status-list {
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-top: var(--space-lg);
}

.status-list li {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.status-list li:last-child {
    margin-bottom: 0;
}

.status-label {
    color: var(--text-muted);
    min-width: 5.5rem;
}

.status-value {
    color: var(--text-secondary);
}

.status-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: var(--space-sm);
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all var(--transition-base);
}

.status-link:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background-color: var(--accent-dim);
    animation: gradient-shift 0.6s ease forwards;
}

.status-link svg {
    width: 10px;
    height: 10px;
}

/* ==========================================================================
   Links
   ========================================================================== */

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

p a {
    color: var(--accent);
    position: relative;
}

p a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-base);
}

p a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    margin-bottom: var(--space-4xl);
    padding-bottom: var(--space-3xl);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    margin-bottom: var(--space-sm);
}

.tagline {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    letter-spacing: 0.01em;
}

/* Social Links */
.social-links {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.social-links a:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background-color: var(--accent-dim);
    transform: translateY(-2px);
    animation: gradient-shift 0.6s ease forwards;
}

@keyframes gradient-shift {
    0% { border-color: var(--accent); color: var(--accent); }
    100% { border-color: var(--accent-secondary); color: var(--accent-secondary); }
}

.social-links svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    margin-bottom: var(--space-4xl);
}

.section:last-of-type {
    margin-bottom: var(--space-3xl);
}

/* ==========================================================================
   Publications
   ========================================================================== */

.pub-list {
    list-style: none;
}

.pub-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--transition-fast);
}

.pub-item:first-child {
    padding-top: 0;
}

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

.pub-item:hover {
    border-color: var(--border-hover);
}

.pub-title {
    display: block;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    transition: color var(--transition-fast);
}

.pub-item:hover .pub-title {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-text-shift 0.6s ease forwards;
}

@keyframes gradient-text-shift {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.pub-meta {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.pub-authors {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.pub-author-me {
    color: #d4d4d8;
}

.pub-venue {
    color: var(--text-muted);
}

.pub-year {
    color: var(--text-muted);
}

.pub-year::before {
    content: '·';
    margin-right: var(--space-md);
    color: var(--border-hover);
}

/* ==========================================================================
   Projects
   ========================================================================== */

.project-grid {
    display: grid;
    gap: var(--space-md);
}

.project-card {
    display: block;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-primary);
    transition: all var(--transition-base);
}

.project-card:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-secondary);
}

.project-card h3 {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.project-card:hover h3 {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-text-shift 0.6s ease forwards;
}

.project-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.project-tech {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-sm);
}

.project-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.project-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.project-links a:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    background-color: var(--accent-dim);
    animation: gradient-shift 0.6s ease forwards;
}

.project-links svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border);
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .hero,
    .section {
        animation: fadeInUp 0.6s ease-out both;
    }
    
    .hero { animation-delay: 0s; }
    .section:nth-of-type(1) { animation-delay: 0.1s; }
    .section:nth-of-type(2) { animation-delay: 0.2s; }
    .section:nth-of-type(3) { animation-delay: 0.3s; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Selection
   ========================================================================== */

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ==========================================================================
   Scrollbar (Webkit)
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

