:root {
    --bg: #ffffff;
    --bg-soft: #f7f9fb;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-strong: #ffffff;
    --ink: #18221b;
    --muted: #59655d;
    --line: rgba(24, 34, 27, 0.12);
    --accent: #c05c29;
    --accent-dark: #994315;
    --accent-soft: rgba(192, 92, 41, 0.08);
    --accent-two: #1f6a68;
    --good-ink: #28543a;
    --good-soft: rgba(188, 223, 194, 0.42);
    --good-line: rgba(86, 134, 96, 0.16);
    --shadow: 0 14px 36px rgba(24, 34, 27, 0.07);
    --radius-lg: 24px;
    --radius-md: 18px;
    --container: 1160px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(31, 106, 104, 0.045), transparent 34%),
        radial-gradient(circle at top right, rgba(192, 92, 41, 0.05), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #fbfcfd 40%, #f8fafb 100%);
    font-family: "Space Grotesk", sans-serif;
    line-height: 1.65;
}

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

a {
    color: inherit;
    text-decoration: none;
}

sup {
    font-size: 0.68em;
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.narrow {
    width: min(calc(100% - 2rem), 960px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(24, 34, 27, 0.08);
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.82);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-logo {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 10px 18px rgba(31, 106, 104, 0.16));
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.topnav a {
    color: var(--muted);
    font-size: 0.94rem;
}

.topnav a:hover,
.topnav a:focus-visible,
.text-links a:hover,
.text-links a:focus-visible,
.related-link:hover,
.related-link:focus-visible {
    color: var(--accent-dark);
}

.paper-hero,
.section {
    padding: 4.5rem 0;
}

.section-muted {
    background: linear-gradient(180deg, rgba(252, 253, 254, 0.72), rgba(247, 249, 251, 0.92));
    border-top: 1px solid rgba(24, 34, 27, 0.06);
    border-bottom: 1px solid rgba(24, 34, 27, 0.06);
}

.paper-intro {
    text-align: center;
}

.eyebrow {
    margin: 0 0 0.8rem;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.paper-title,
.section-heading h2,
.table-panel-head h3,
.resource-copy h3,
.related-card h3 {
    font-family: "Source Serif 4", serif;
}

.paper-title {
    display: inline-block;
    margin: 0 auto;
    max-width: none;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-align: center;
}

.paper-title-line {
    display: block;
    white-space: nowrap;
}

.paper-title-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.38em;
    margin-right: 0.14em;
    white-space: nowrap;
}

.hero-logo-inline {
    width: 1.04em;
    height: 1.04em;
    transform: translateY(0.03em);
    filter: drop-shadow(0 16px 24px rgba(31, 106, 104, 0.18));
}

.paper-tldr {
    max-width: 52rem;
    margin: 1rem auto 1.2rem;
    color: var(--muted);
    font-size: 0.98rem;
}

.paper-tldr strong {
    color: var(--ink);
}

.paper-authors,
.paper-affiliations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 1rem;
    margin: 0;
}

.paper-authors {
    font-size: 1rem;
    font-weight: 500;
}

.author-link {
    color: inherit;
    text-decoration: none;
    transition: color 180ms ease;
}

.author-link-name {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: auto;
    text-underline-offset: 0.1em;
    text-decoration-color: rgba(24, 34, 27, 0.18);
}

.author-link:hover,
.author-link:focus-visible {
    color: var(--accent-dark);
}

.author-link:hover .author-link-name,
.author-link:focus-visible .author-link-name {
    text-decoration-color: rgba(153, 67, 21, 0.45);
}

.paper-affiliations,
.paper-note,
.section-heading p,
figcaption,
.muted,
.resource-copy p,
.demo-label span,
.demo-slot span {
    color: var(--muted);
}

.paper-affiliations {
    margin-top: 0.85rem;
}

.paper-note {
    margin: 0.45rem 0 0;
    font-size: 0.95rem;
}

.paper-links,
.fact-row,
.text-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.paper-links {
    margin-top: 1.7rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.78rem 1.15rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.94rem;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.button:hover,
.button:focus-visible,
.preview-frame:hover,
.preview-frame:focus-visible {
    transform: translateY(-1px);
}

.button.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, #d07434 100%);
    box-shadow: 0 14px 28px rgba(192, 92, 41, 0.16);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(24, 34, 27, 0.12);
}

.fact-row {
    margin-top: 1.35rem;
}

.fact-chip,
.demo-head {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.42rem 0.86rem;
    border-radius: 999px;
    border: 1px solid rgba(24, 34, 27, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    font-size: 0.9rem;
}

.video-placeholder {
    margin-top: 2.2rem;
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(31, 106, 104, 0.06), rgba(192, 92, 41, 0.04)),
        var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-placeholder-inner {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-align: center;
}

.video-placeholder-inner strong {
    font-size: 1.15rem;
    font-weight: 700;
}

.play-icon {
    position: relative;
    display: inline-flex;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 32px rgba(31, 106, 104, 0.14);
}

.play-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid var(--accent-dark);
    transform: translate(-35%, -50%);
}

.preview-frame {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid rgba(24, 34, 27, 0.08);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
}

.preview-frame-plain {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.section-heading {
    margin-bottom: 1.6rem;
}

.section-heading.centered {
    text-align: center;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.section-heading p {
    max-width: 46rem;
    margin: 0.7rem auto 0;
}

.scholarly-panel {
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.prose {
    padding: 1.6rem 1.8rem;
    font-size: 1rem;
}

.prose a {
    color: var(--accent-dark);
}

.prose p:first-child {
    margin-top: 0;
}

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

.abstract-prose p {
    text-align: justify;
    text-align-last: left;
    text-justify: inter-word;
    hyphens: auto;
}

.visual-grid,
.resource-grid,
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.3rem;
}

.visual-single {
    max-width: 1120px;
    margin: 0 auto;
}

.feature-figure {
    margin: 0;
}

.overview-frame {
    width: 80%;
    margin: 0 auto;
}

figcaption {
    margin-top: 0.9rem;
    font-size: 0.95rem;
}

.feature-figure figcaption {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.72;
    text-align: justify;
    text-align-last: left;
}

.katex-caption .katex {
    font-size: 1em;
}

.katex-caption .katex-html {
    line-height: 1.15;
}

.demo-grid {
    display: grid;
    grid-template-columns: minmax(140px, 180px) repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
    align-items: stretch;
}

.demo-head-empty {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.demo-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.1rem;
    border-left: 2px solid rgba(31, 106, 104, 0.22);
}

.demo-label strong {
    font-size: 1rem;
    font-weight: 700;
}

.demo-slot {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px dashed rgba(24, 34, 27, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(31, 106, 104, 0.04), rgba(255, 255, 255, 0.78)),
        rgba(255, 255, 255, 0.86);
    text-align: center;
}

.demo-slot-accent {
    background:
        linear-gradient(145deg, rgba(192, 92, 41, 0.05), rgba(255, 255, 255, 0.82)),
        rgba(255, 255, 255, 0.86);
}

.demo-compare {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    gap: 1.3rem;
}

.demo-scene-current {
    display: grid;
    gap: 0.24rem;
    text-align: center;
}

.demo-scene-current-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.55rem 0.8rem;
}

.demo-scene-current-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.demo-scene-current h3 {
    margin: 0;
    font-size: clamp(1.16rem, 2vw, 1.46rem);
    letter-spacing: 0.01em;
}

.demo-scene-pair {
    margin: 0;
    color: var(--muted);
    font-size: 0.96rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.demo-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
}

.demo-viewer-card {
    margin: 0;
    display: grid;
    gap: 0.78rem;
    padding: 1rem;
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
        rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 44px rgba(24, 34, 27, 0.05);
}

.demo-viewer-head {
    display: grid;
    gap: 0;
    justify-items: center;
    text-align: center;
    min-height: 1.1rem;
}

.demo-mode-label {
    margin: 0;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.demo-viewer-card h3 {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.24rem);
    letter-spacing: 0.01em;
}

.demo-model-viewer {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(360px, 38vw, 500px);
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95) 56%, rgba(242, 245, 248, 0.96)),
        linear-gradient(180deg, rgba(31, 106, 104, 0.015), rgba(192, 92, 41, 0.018));
}

.demo-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.demo-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 248, 250, 0.58));
    backdrop-filter: blur(2px);
}

.demo-status[hidden] {
    display: none !important;
}

.demo-status.is-error {
    color: #8e3023;
    background: linear-gradient(180deg, rgba(255, 244, 242, 0.92), rgba(252, 235, 232, 0.78));
}

.demo-model-viewer.is-error {
    border-color: rgba(180, 48, 32, 0.4);
}

.demo-scene-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.88rem;
}

.demo-scene-button {
    display: grid;
    gap: 0.72rem;
    padding: 0.78rem;
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.demo-scene-button:hover,
.demo-scene-button:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(31, 106, 104, 0.2);
    box-shadow: 0 14px 28px rgba(24, 34, 27, 0.08);
}

.demo-scene-button.is-active {
    border-color: rgba(31, 106, 104, 0.3);
    background:
        linear-gradient(180deg, rgba(248, 253, 249, 0.98), rgba(244, 249, 246, 0.94)),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 30px rgba(31, 106, 104, 0.12);
}

.demo-scene-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1.45 / 1;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px dashed rgba(24, 34, 27, 0.16);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 249, 0.96)),
        rgba(255, 255, 255, 0.92);
}

.demo-scene-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-scene-name {
    display: block;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.2;
}

.demo-scene-meta {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.2;
}

.demo-footnote {
    margin: 0.08rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.table-stack {
    display: grid;
    gap: 1.3rem;
}

.experiment-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.3rem;
}

.experiment-tab {
    min-height: 40px;
    padding: 0.48rem 0.92rem;
    border: 1px solid rgba(24, 34, 27, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.experiment-tab:hover,
.experiment-tab:focus-visible {
    color: var(--accent-dark);
    transform: translateY(-1px);
}

.experiment-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent) 0%, #d07434 100%);
    box-shadow: 0 10px 24px rgba(192, 92, 41, 0.16);
}

.table-panel {
    padding: 1.35rem;
}

.experiment-panel[hidden] {
    display: none;
}

.table-panel-head {
    margin-bottom: 0.95rem;
}

.table-panel-head h3 {
    margin: 0;
    font-size: 1.42rem;
    line-height: 1.08;
}

.table-panel-head p {
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

th,
td {
    padding: 0.74rem 0.58rem;
    text-align: left;
    border-bottom: 1px solid rgba(24, 34, 27, 0.08);
    white-space: nowrap;
}

thead th {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.multi-head thead tr + tr th {
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.full-results-table {
    font-size: 0.88rem;
}

.full-results-table th,
.full-results-table td {
    padding: 0.62rem 0.5rem;
}

.rules-table td:last-child,
.formula-cell {
    white-space: normal;
}

.formula-cell .katex {
    font-size: 1em;
}

.math-render .katex {
    font-size: 1em;
}

.table-group-row td {
    padding-top: 0.56rem;
    padding-bottom: 0.56rem;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(192, 92, 41, 0.06);
}

.with-memix td {
    background: var(--accent-soft);
}

.reconstruction-table .with-memix td,
.metrics-table .with-memix td {
    background: transparent;
}

.metric-better {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.95rem;
    padding: 0.12rem 0.54rem;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(225, 241, 228, 0.94), rgba(213, 234, 217, 0.82)),
        var(--good-soft);
    box-shadow:
        inset 0 0 0 1px var(--good-line),
        0 8px 18px rgba(86, 134, 96, 0.08);
    color: var(--good-ink);
    font-weight: 700;
}

.resource-card,
.related-card {
    padding: 1.35rem;
}

.resource-copy h3,
.related-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.4rem;
    line-height: 1.08;
}

.resource-copy p,
.related-card p {
    margin: 0;
    color: var(--muted);
}

.text-links {
    justify-content: flex-start;
    margin-top: 0.9rem;
}

.text-links a,
.related-link {
    color: var(--accent-dark);
    font-weight: 700;
}

.related-card .related-link {
    display: inline-flex;
    margin-top: 0.9rem;
}

.code-panel {
    overflow-x: auto;
    padding: 1.15rem 1.25rem;
}

pre {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.site-footer {
    padding: 2rem 0 3rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-size: 0.94rem;
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: fade-up 680ms ease forwards;
}

.delay-1 {
    animation-delay: 150ms;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .visual-grid,
    .visual-single,
    .resource-grid,
    .related-grid,
    .demo-grid {
        grid-template-columns: 1fr;
    }

    .paper-title {
        font-size: clamp(1.28rem, 4.6vw, 1.95rem);
    }

    .demo-head-empty {
        display: none;
    }

    .demo-head {
        display: none;
    }

    .demo-compare-grid {
        grid-template-columns: 1fr;
    }

    .demo-scene-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .demo-model-viewer {
        height: clamp(340px, 70vw, 540px);
    }
}

@media (max-width: 720px) {
    .paper-hero,
    .section {
        padding: 4rem 0;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem 0;
    }

    .topnav {
        gap: 0.85rem;
    }

    .paper-title {
        font-size: clamp(1.16rem, 4.3vw, 1.55rem);
    }

    .overview-frame {
        width: 100%;
    }

    .section-heading h2 {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    .video-placeholder-inner {
        min-height: 280px;
    }

    .scholarly-panel,
    .preview-frame,
    .demo-slot {
        border-radius: 20px;
    }

    .demo-model-viewer {
        height: 320px;
        border-radius: 20px;
    }

    .demo-viewer-card {
        padding: 0.88rem;
        border-radius: 22px;
    }

    .demo-scene-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .prose,
    .table-panel,
    .resource-card,
    .related-card,
    .code-panel {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}
