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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: #333;
    background: #fff;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout === */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero .title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.authors {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.authors a {
    color: #93c5fd;
}

.authors a:hover {
    color: #fff;
}

.affiliations {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.3rem;
}

.equal-contrib {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.links .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.links .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

/* === Sections === */
.section {
    padding: 3.5rem 0;
}

.alt-bg {
    background: #f8fafc;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.subsection-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #334155;
}

/* === Abstract === */
.abstract-text {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

.abstract-text .tldr {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 6px 6px 0;
}

/* === Highlights === */
.highlights {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    border-radius: 0 6px 6px 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.highlights-title {
    font-size: 1rem;
    font-weight: 700;
    color: #166534;
    margin-bottom: 0.3rem;
}

.highlight-item {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 1rem;
}

.highlight-arrow {
    font-size: 1.3rem;
    font-weight: 700;
    color: #16a34a;
    flex-shrink: 0;
    line-height: 1;
}

/* === Figures === */
.figure-placeholder {
    margin: 2rem 0;
    text-align: center;
}

.figure-placeholder img {
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Placeholder styling for missing images */
    min-height: 200px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.figure-placeholder img[src$=".png"]:not([src^="http"]) {
    min-height: 200px;
}

.caption {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.75rem;
    font-style: italic;
}

.figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* === Tables === */
.table-container {
    margin: 2rem 0;
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table th,
.results-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th {
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
}

.results-table tbody tr:hover {
    background: #f1f5f9;
}

.results-table .moljepa-col {
    background: #eff6ff;
}

.results-table thead .moljepa-col {
    background: #1e40af;
}

.results-table .group-header {
    background: #e2e8f0 !important;
    font-weight: 600;
}

.results-table .group-header td {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.results-table .average-row {
    background: #e2e8f0 !important;
    border-top: 2px solid #94a3b8;
}

.std {
    color: #94a3b8;
    font-size: 0.75em;
}

.highlight-row {
    background: #eff6ff !important;
}

/* === Equation === */
.equation {
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
}

/* === Citation === */
.citation-box {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
}

.citation-box pre {
    margin: 0;
}

.citation-box code {
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === Footer === */
.footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero .title {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 2.5rem 0;
    }

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