/* Base Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
    --orange: #f97316;
    --blue: #3b82f6;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

section {
    padding: 60px 0;
}

section:nth-child(even) {
    background: var(--bg-alt);
}

/* Hero */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.hero .title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.hero .venue {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

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

.hero .affiliations {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
}

/* TL;DR */
.tldr {
    background: var(--bg);
}

.tldr ul {
    max-width: 800px;
    margin: 0 auto;
    list-style: none;
}

.tldr li {
    padding: 12px 0;
    padding-left: 28px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.tldr li:last-child {
    border-bottom: none;
}

.tldr li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* Key Insight */
.key-insight {
    background: var(--bg-alt);
}

.insight-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.insight-box {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    min-width: 280px;
    flex: 1;
    max-width: 400px;
}

.insight-box.highlight {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.insight-box h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.insight-box .approach {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.insight-box .diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.insight-box .step {
    background: var(--bg-alt);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.insight-box .step.final {
    background: var(--primary);
    color: white;
}

.insight-box .arrow {
    color: var(--text-light);
}

.insight-box .dots {
    color: var(--text-light);
}

.insight-box .cost {
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.vs {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-light);
}

/* Visualization */
.visualization {
    text-align: center;
}

.section-desc {
    max-width: 700px;
    margin: 0 auto 2rem;
    color: var(--text-light);
}

/* V label styling - simple red text, no border */
.v-label {
    font-weight: 700;
    font-style: italic;
    color: #dc2626;
}

/* Toy cases grid */
.toy-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto 2rem;
}

@media (max-width: 900px) {
    .toy-cases-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

.toy-case {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.toy-case-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.05rem;
    text-align: center;
}

.toy-case .gif-container {
    margin: 0;
    border-radius: 8px;
    box-shadow: none;
}

.toy-case-desc {
    margin: 12px 0 0 0;
    font-size: 0.88rem;
    color: var(--text-light);
    text-align: center;
}

.gif-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.gif-container img {
    width: 100%;
    display: block;
}

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

/* Method */
.method {
    background: var(--bg);
}

.method-block {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.method-block h3 {
    color: var(--primary);
}

.equation-block {
    background: var(--bg-alt);
    padding: 20px 24px;
    border-radius: 8px;
    margin: 1rem 0;
    overflow-x: auto;
    text-align: center;
}

.equation-block.small {
    font-size: 0.9rem;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

.text-col p {
    color: var(--text);
}

.image-col img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Algorithm */
.algorithm {
    background: var(--bg-alt);
}

.code-block {
    max-width: 700px;
    margin: 0 auto;
}

.code-block pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Results */
.results {
    background: var(--bg);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 3rem;
}

@media (max-width: 600px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.result-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.result-card .metric {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.result-card .label {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 8px 0 4px;
}

.result-card .detail {
    font-size: 0.85rem;
    color: var(--text-light);
}

.samples-gallery {
    text-align: center;
}

.samples-gallery img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Tutorial */
.tutorial {
    text-align: center;
    background: var(--bg-alt);
}

.tutorial > .container > p {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-light);
}

.notebook-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .notebook-preview {
        grid-template-columns: 1fr;
    }
}

.notebook-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
}

.notebook-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.notebook-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* BibTeX */
.bibtex {
    background: var(--bg);
}

.bibtex pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

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

footer a:hover {
    text-decoration: underline;
}

/* Project-page add-ons */
.top-nav {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 18px;
}

.back-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.9;
}

.back-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.resources {
    background: var(--bg-alt);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .resources-grid {
        grid-template-columns: 1fr;
    }
}

.resource-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}

.resource-card.highlight {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.14);
}

.resource-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.resource-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.resource-media img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}

.resource-actions {
    margin: 10px 0 14px;
}

.resource-actions.inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.35);
}

.btn-outline:hover {
    background: rgba(37, 99, 235, 0.08);
}

.figure-links {
    text-align: center;
    margin-top: 12px;
}

.figure-links a {
    margin: 0 6px;
}

/* Slightly smaller tiles to avoid looking blurry on HiDPI displays */
.toy-table {
    max-width: 980px;
}

.sample-grid-large {
    max-width: 720px;
}

.sample-grid-large img {
    aspect-ratio: auto;
    object-fit: contain;
}

.repo-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.repo-list li {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
    color: var(--text);
    font-size: 0.95rem;
}

.repo-list li:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.colab-ad {
    margin-top: 12px;
}

.colab-ad-inner {
    background: #0b1220;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    overflow: hidden;
}

.colab-ad-title {
    padding: 10px 12px;
    color: #cbd5e1;
    font-weight: 600;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.6);
}

.colab-placeholder {
    width: 100%;
    height: auto;
    display: block;
}

.toy-table {
    border-collapse: separate;
    border-spacing: 12px 12px;
    margin: 0 auto;
    max-width: 1100px;
}

.toy-table th {
    font-size: 1.05rem;
    color: var(--primary);
}

.toy-table img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border);
}

.callout {
    max-width: 900px;
    margin: 18px auto 0;
    padding: 18px 18px;
    border-radius: 14px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    text-align: center;
}

.callout-title {
    font-weight: 800;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.callout-body {
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.35;
}

/* Teaser */
.teaser {
    text-align: center;
}

.teaser-image {
    max-width: 900px;
    margin: 0 auto;
}

.teaser-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Field Design */
.field-design {
    background: var(--bg-alt);
}

/* Extensions */
.extensions {
    background: var(--bg);
}

.extension-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .extension-grid {
        grid-template-columns: 1fr;
    }
}

.extension-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.extension-card h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.extension-card .equation-block {
    margin: 1rem 0;
}

/* Sample Grid */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .sample-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sample-grid img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Code Block */
.code-block {
    margin: 1rem 0;
}

.code-block pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px 24px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Tutorial 4 cards */
.notebook-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .notebook-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .notebook-preview {
        grid-template-columns: 1fr;
    }
}

/* Author links */
.hero .authors a {
    color: var(--text);
    text-decoration: none;
}

.hero .authors a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* New Paradigm Section (combined teaser + motivation) */
.new-paradigm {
    background: var(--bg);
}

.new-paradigm .method-block {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.new-paradigm .method-block h3 {
    color: var(--primary);
}

.new-paradigm ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.new-paradigm ol li {
    margin-bottom: 0.5rem;
}

.new-paradigm .teaser-image {
    max-width: 900px;
    margin: 2rem auto 0;
}

.new-paradigm .teaser-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.new-paradigm .caption {
    text-align: center;
    max-width: 900px;
    margin: 1rem auto 0;
}

/* Larger Sample Grid (3x4) */
.sample-grid-large {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .sample-grid-large {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    .sample-grid-large {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sample-grid-large img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Samples Note */
.samples-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Comparison Gallery */
.comparison-gallery {
    max-width: 900px;
    margin: 2rem auto 0;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0.5rem;
    padding-left: 80px;
}

.comparison-label {
    text-align: center;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 700px) {
    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    .comparison-row {
        padding-left: 60px;
    }
}

.comparison-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: relative;
}

.comparison-pair img {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-pair .class-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}
