/* ========================================
   CSS Variables - CMU Color Scheme
   ======================================== */
:root {
    /* CMU Brand Colors */
    --cmu-red: #C41230;
    --cmu-red-dark: #9B0E26;
    --cmu-red-light: #D93D57;
    --cmu-gray: #5C6670;
    --cmu-gray-dark: #3E464D;
    --cmu-gray-light: #9BA5AE;

    /* Neutral Colors */
    --white: #FFFFFF;
    --off-white: #F8F9FA;
    --light-gray: #E9ECEF;
    --medium-gray: #DEE2E6;
    --text-dark: #212529;
    --text-medium: #495057;
    --text-light: #6C757D;

    /* Accent Colors */
    --accent-blue: #4A90E2;
    --accent-green: #27AE60;
    --accent-yellow: #F39C12;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --section-padding: 80px 0;
    --container-width: 1200px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.7;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--cmu-red-dark);
}

ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

strong, em {
    font-weight: 600;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--light-gray);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.section-gray {
    background-color: var(--off-white);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--cmu-red);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--cmu-red), var(--cmu-red-light));
    border-radius: 2px;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: all var(--transition-base);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cmu-red);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-medium);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--cmu-red);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding-top: 140px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, var(--off-white) 0%, var(--white) 100%);
    text-align: center;
}

.title {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.authors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.author {
    color: var(--text-medium);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.author:hover {
    color: var(--cmu-red);
}

.affiliation {
    font-size: 1.05rem;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.equal-contribution {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 2rem;
}

.impact-statement {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-medium);
    max-width: 900px;
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background-color: rgba(196, 18, 48, 0.05);
    border-left: 4px solid var(--cmu-red);
    border-radius: 8px;
}

.highlight {
    color: var(--cmu-red);
    font-weight: 700;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--cmu-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--cmu-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--cmu-red);
    border: 2px solid var(--cmu-red);
}

.btn-secondary:hover {
    background-color: var(--cmu-red);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   Abstract Section
   ======================================== */
.abstract-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-medium);
}

/* ========================================
   Key Insight Section
   ======================================== */
.insight-content {
    max-width: 1000px;
    margin: 0 auto;
}

.insight-text {
    font-size: 1.25rem;
    text-align: center;
    color: var(--text-medium);
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

/* ========================================
   Problem Setup Section
   ======================================== */
.problem-content h3 {
    color: var(--cmu-red);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.difficulty-axes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.axis {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--cmu-red);
}

.axis h4 {
    color: var(--cmu-red);
    margin-bottom: 1rem;
}

/* ========================================
   Results Section
   ======================================== */
.results-content h3 {
    color: var(--cmu-red);
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.results-content h3:first-child {
    margin-top: 0;
}

/* ========================================
   Figures
   ======================================== */
.figure {
    margin: 2.5rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    align-items: start;
    justify-items: center;
}

.figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.figure img:hover {
    transform: scale(1.02);
}

.figure-caption {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
}

/* ========================================
   Dataset Section
   ======================================== */
#dataset {
    padding-bottom: 40px;
}

#citation {
    padding-top: 40px;
}

.coming-soon-badge {
    display: inline-block;
    background-color: var(--accent-yellow);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.dataset-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border-top: 4px solid var(--cmu-red);
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cmu-red);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.stat-desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

.dataset-note {
    background-color: rgba(196, 18, 48, 0.05);
    border-left: 4px solid var(--cmu-red);
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: 8px;
    font-size: 1.05rem;
}

/* ========================================
   Code Section
   ======================================== */
.repo-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background-color: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    margin: 2rem 0;
    transition: all var(--transition-base);
}

.repo-link:hover {
    border-color: var(--cmu-red);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.repo-link svg {
    color: var(--text-dark);
}

.repo-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.repo-desc {
    font-size: 1rem;
    color: var(--text-light);
}

.code-block {
    background-color: var(--cmu-gray-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--light-gray);
    background-color: transparent;
    padding: 0;
}

/* ========================================
   Citation Section
   ======================================== */
.bibtex-container {
    position: relative;
    background-color: var(--cmu-gray-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--cmu-red);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.copy-btn:hover {
    background-color: var(--cmu-red-dark);
}

#bibtex-code {
    margin: 0;
}

#bibtex-code code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--light-gray);
    background-color: transparent;
    padding: 0;
    padding-right: 120px;
}

/* ========================================
   Footer
   ======================================== */
footer {
    background-color: var(--cmu-gray-dark);
    color: var(--light-gray);
    padding: 2rem 0;
    text-align: center;
}

footer a {
    color: var(--cmu-red-light);
}

footer p {
    margin-bottom: 0.5rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .title {
        font-size: 2.25rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

    .hero {
        padding-top: 100px;
    }

    .title {
        font-size: 1.75rem;
    }

    .authors {
        flex-direction: column;
        gap: 0.5rem;
    }

    .buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    .section {
        padding: 60px 0;
    }

    .difficulty-axes {
        grid-template-columns: 1fr;
    }

    .dataset-stats {
        grid-template-columns: 1fr;
    }

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

    .impact-statement {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }

    #bibtex-code code {
        font-size: 0.75rem;
        padding-right: 0;
    }

    .copy-btn {
        position: static;
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .nav-container {
        padding: 0.75rem 15px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}
