:root {
    --bg-color: #ffffff;
    --text-color: #2c2c2c;
    --text-secondary: #5a5a5a;
    --text-muted: #8a8a8a;
    --border-color: #e0ddd8;
    --link-color: #2c2c2c;
    --accent-nyu: #57068c;
    --teal: #009b8a;
}

[data-theme="dark"] {
    --bg-color: #1a1917;
    --text-color: #e4e0d5;
    --text-secondary: #a8a090;
    --text-muted: #6e6658;
    --border-color: #363330;
    --link-color: #e4e0d5;
    --accent-nyu: #b06ee8;
}

* { box-sizing: border-box; }

body {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 19px;
    line-height: 1.75;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 36px 32px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    animation: pageLoad 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Theme toggle */
.top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 40px;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}
#theme-toggle:hover { opacity: 1; }

/* Hero */
.hero {
    margin-bottom: 24px;
    text-align: center;
}

/* SDO overlay */
.aia-wrapper {
    position: relative;
}

.sdo-overlay {
    position: absolute;
    bottom: -18px;
    right: -60px;
    width: 22% !important;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.18));
    pointer-events: none;
}

/* Teaser figures */
.teasers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.teasers .figure {
    margin: 0;
}

.teasers .teaser-panel {
    max-width: 80%;
    margin: 0 auto;
}

h1 {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 24px 0;
    color: var(--text-color);
}

.method {
    color: var(--accent-nyu);
}

/* Authors */
.authors {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.9;
}

.authors a {
    color: var(--text-color);
    background: none;
}

.authors a:hover {
    color: var(--accent-nyu);
    background: none;
}

.affiliations {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Venue badges */
.venues {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.badge {
    font-size: 13px;
    font-family: 'Palatino Linotype', Palatino, serif;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    background: none;
    text-decoration: none;
}

.badge:hover {
    border-color: var(--accent-nyu);
    color: var(--accent-nyu);
    background: none;
}

/* Action buttons */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
    justify-content: center;
}

.btn {
    font-size: 15px;
    font-family: 'Palatino Linotype', Palatino, serif;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    background: none;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
    transition: border-color 0.2s, color 0.2s;
}

.btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: none;
}

/* Sections */
section {
    border-top: 1px solid var(--border-color);
    padding: 36px 0;
}

h2 {
    font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-color);
}

p {
    margin: 0 0 16px 0;
    color: var(--text-color);
}

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

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    background-image: linear-gradient(var(--border-color), var(--border-color));
    background-size: 100% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease, color 0.2s ease;
}

a:hover {
    background-image: linear-gradient(var(--text-color), var(--text-color));
}

/* Comparison table */
.comparison-table {
    margin: 16px 0 0 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    font-size: 17px;
}

.comparison-header,
.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.comparison-header {
    background: var(--border-color);
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.comparison-col-label {
    text-align: center;
}

.comparison-row {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    align-items: center;
}

.comparison-metric {
    color: var(--text-secondary);
    font-size: 15px;
}

.comparison-val {
    text-align: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-muted);
}

.method-label {
    color: var(--accent-nyu);
    font-weight: 700;
}

.method-val {
    color: var(--accent-nyu);
}



/* Inline colorbars */
.inline-colorbar {
    height: 1.1em;
    width: 2.2em;
    vertical-align: middle;
    border: none !important;
    border-radius: 2px !important;
    background: none !important;
    display: inline;
    margin: 0 2px;
}

/* Figures */
.figure {
    margin: 28px 0;
}

.figure img:not(.inline-colorbar) {
    width: 100%;
}

[data-theme="dark"] .figure img {
    background: #1a1917;
}

.figure figcaption {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.6;
}

.figure figcaption strong {
    color: var(--text-secondary);
}

/* Wrap figures */
.wrap-block {
    overflow: hidden;
    margin: 28px 0;
}

.figure-wrap-right {
    float: right;
    width: 32%;
    margin: 4px 0 20px 28px;
}

.figure-wrap-left {
    float: left;
    width: 32%;
    margin: 4px 28px 20px 0;
}

/* BibTeX */
.bibtex {
    background: var(--border-color);
    border-radius: 8px;
    padding: 20px 24px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre;
    margin-top: 8px;
}

/* Footer */
footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
    body { padding: 40px 20px; font-size: 17px; }
    h1 { font-size: 26px; }
    .stats { grid-template-columns: 1fr; }
    .venues, .actions { flex-direction: column; }
    .figure-wrap-right, .figure-wrap-left {
        float: right;
        width: 42%;
        margin: 4px 0 16px 18px;
    }
}
