/* ===================================
   TransNormal - Project Page Styles
   =================================== */

/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-alt: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --max-width: 1200px;
    --best-color: rgb(255, 166, 166);
    --second-color: rgb(255, 191, 191);
    --third-color: rgb(255, 230, 230);
    --bestlora-color: rgb(255, 204, 204);
}

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

html {
    scroll-behavior: smooth;
}

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

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

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

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* ===================================
   Hero Section
   =================================== */
.hero {
    padding: 120px 24px 60px;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-header {
    margin-bottom: 24px;
}

.hero-title {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    max-width: 960px;
    margin: 0 auto;
    font-family: var(--font-display);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.hero-separator {
    display: none;
}

.hero-title-main {
    font-size: clamp(2.6rem, 3.4vw + 1.2rem, 3.6rem);
    font-weight: 700;
    color: var(--text-primary);
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
    .hero-title-main {
        background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 45%, #06b6d4 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: clamp(1.05rem, 1.1vw + 0.9rem, 1.55rem);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    text-wrap: balance;
}

/* Hero Teaser */
.hero-teaser {
    max-width: 1000px;
    margin: 52px auto 40px;
    position: relative;
    z-index: 1;
}

.hero-teaser .teaser-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.hero-teaser .teaser-image img {
    width: 100%;
    display: block;
}

/* Hero Highlights */
.hero-highlights {
    display: flex;
    justify-content: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.highlight-card {
    flex: 1;
    max-width: 240px;
    padding: 24px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.highlight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.highlight-card .highlight-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.highlight-card .highlight-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.authors {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

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

.author sup {
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 600;
}

.affiliations {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.affiliations span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.affiliations sup {
    color: var(--primary-color);
    font-weight: 600;
}

.corresponding-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.corresponding i {
    font-size: 0.7rem;
    margin-right: 4px;
}

.venue-badge {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.venue-badge span {
    background: rgba(100, 116, 139, 0.08);
    color: #64748b;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Buttons */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

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

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

.btn-secondary {
    background: var(--bg-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.badge {
    font-size: 0.6875rem;
    padding: 2px 8px;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Highlights */
.highlights {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.highlight-item {
    text-align: center;
}

.highlight-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.highlight-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===================================
   Teaser Section
   =================================== */
.teaser {
    padding: 40px 24px 80px;
}

.teaser-image {
    max-width: 1000px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.teaser-image img {
    width: 100%;
}

.teaser-caption {
    max-width: 800px;
    margin: 24px auto 0;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   Sections
   =================================== */
.section {
    padding: 80px 24px;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.subsection-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.subsection-desc {
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 800px;
}

/* ===================================
   Abstract
   =================================== */
.abstract-content {
    max-width: 800px;
    margin: 0 auto;
}

.abstract-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 1.0625rem;
    line-height: 1.7;
}

.abstract-content strong {
    color: var(--text-primary);
}

/* ===================================
   Method Section
   =================================== */
.pipeline-image {
    max-width: 1000px;
    margin: 0 auto 48px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.pipeline-image img {
    width: 100%;
    background: white;
}

.method-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 64px;
}

.method-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.method-card:hover {
    box-shadow: var(--shadow-md);
}

.method-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.method-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.method-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   Results Section
   =================================== */
.results-table-wrapper {
    margin-bottom: 64px;
}

.table-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

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

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
    text-align: left;
    padding-left: 20px;
}

.results-table tbody tr:hover {
    background: var(--bg-secondary);
}

.results-table tbody tr.ours {
    background: rgba(37, 99, 235, 0.05);
}

.results-table tbody tr.ours:hover {
    background: rgba(37, 99, 235, 0.1);
}

.results-table .best {
    background: var(--best-color);
    font-weight: 600;
}

.results-table .second {
    background: var(--second-color);
}

.results-table .third {
    background: var(--third-color);
}

/* Qualitative Section */
.qualitative-section {
    text-align: center;
}

/* Comparison Slider */
.comparison-gallery {
    max-width: var(--max-width);
    margin: 0 auto 48px;
}

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

.comparison-tile {
    width: 100%;
}

.comparison-triple-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    cursor: ew-resize;
    touch-action: pan-y;
    user-select: none;
}

.comparison-triple-container img {
    width: 100%;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.comparison-triple-container .img-input {
    position: relative;
}

.comparison-triple-container .img-baseline,
.comparison-triple-container .img-ours {
    position: absolute;
    top: 0;
    left: 0;
}

.comparison-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    cursor: ew-resize;
    touch-action: pan-y;
    user-select: none;
}

.comparison-container img {
    width: 100%;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}

.comparison-container .img-ours {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    clip-path: inset(0 0 0 50%);
}

.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.handle-line {
    flex: 1;
    width: 2px;
    background: white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.handle-circle {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.comparison-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    padding: 12px 16px 0;
}

.comparison-labels span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

.comparison-labels .label-left {
    text-align: left;
}

.comparison-labels .label-right {
    text-align: right;
}

/* Static Comparison Grid */
.static-comparison {
    max-width: 900px;
    margin: 0 auto;
}

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

.grid-item {
    text-align: center;
}

.grid-item img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
}

.grid-item span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ===================================
   Dataset Section
   =================================== */
.dataset-overview {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 48px;
}

.dataset-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.dataset-desc {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.dataset-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.dataset-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* ===================================
   Citation Section
   =================================== */
.citation-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.bibtex-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.bibtex-code {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* ===================================
   Footer
   =================================== */
.footer {
    padding: 48px 24px;
    background: var(--text-primary);
    color: var(--text-muted);
    text-align: center;
}

.footer-content p {
    margin-bottom: 8px;
}

.footer-note {
    font-size: 0.8125rem;
    opacity: 0.7;
}

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

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

    .highlights {
        gap: 32px;
    }

    .highlight-value {
        font-size: 2rem;
    }

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

    .dataset-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .hero {
        padding: 120px 16px 60px;
    }

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

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

    .section {
        padding: 60px 16px;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 32px;
    }

    .authors {
        flex-direction: column;
        gap: 8px;
    }

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

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .highlights {
        flex-direction: column;
        gap: 24px;
    }

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

    .results-table {
        font-size: 0.75rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px 10px;
    }

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

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

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

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}
