/* EpiFormer project page. Built on the Academic Project Page template (Bulma), in the palette of the paper's architecture figure. */
:root {
  --navy: #1D3557;
  --navy-soft: #2F4B73;
  --blue: #4A69A8;          /* the cross-attention curves of the figure, darkened for text */
  --blue-dark: #36508A;
  --blue-tint: #EEF2FA;
  --red: #B84A4A;           /* epitope residues */
  --red-tint: #F8ECEC;
  --green: #4E8C38;         /* antibody heavy chain */
  --cyan: #6FB8C4;          /* antibody light chain */
  --sand: #F8F6F0;          /* the encoder panel of the figure */
  --gray: #5F6368;
  --rule: #E1E3E8;
  --text: #1B2433;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(29, 53, 87, 0.08);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; background: #fff; }
body { font-family: var(--serif); color: var(--text); font-size: 17px; line-height: 1.6; background: #fff; -webkit-font-smoothing: antialiased; }
.title, .subtitle, .content h2, .content h3, .content h4 { font-family: var(--serif) !important; color: var(--navy) !important; }
.content p { color: var(--text); }
a { color: var(--blue-dark); }
a:hover { color: var(--navy); }
strong { color: inherit; }

/* scroll progress */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--blue), var(--red)); z-index: 50; }

/* hero */
.hero .hero-body { padding-top: 4rem; padding-bottom: 1.5rem; }
.publication-title { font-size: 4rem !important; letter-spacing: 0.01em; margin-bottom: 0.6rem !important; }
.publication-subtitle { font-weight: 400; line-height: 1.35; max-width: 48rem; margin: 0 auto 1.4rem auto !important; }
.publication-authors { font-family: var(--serif); color: var(--navy); }
.publication-authors a { color: var(--blue-dark) !important; border-bottom: 1px dotted var(--blue); }
.author-block { display: inline-block; margin: 0 0.35rem; }
.affiliations { color: var(--gray); margin-top: 0.3rem; font-size: 1.05rem; }
.author-note { color: var(--gray); font-size: 0.92rem; margin-top: 0.4rem; }
.publication-links { margin-top: 1.4rem; }
.link-block { display: inline-block; margin: 0.25rem 0.2rem; }
.button.is-dark { background-color: var(--navy) !important; border: none; font-family: var(--serif); transition: transform 0.15s ease, background-color 0.15s ease; }
.button.is-dark:hover { background-color: var(--blue-dark) !important; transform: translateY(-1px); }
.button.is-placeholder { opacity: 0.55; cursor: default; }
.button.is-placeholder:hover { background-color: var(--navy) !important; transform: none; }

.hero-fade { opacity: 0; transform: translateY(10px); animation: heroIn 0.7s ease forwards; }
.hero-fade-1 { animation-delay: 0.05s; } .hero-fade-2 { animation-delay: 0.18s; } .hero-fade-3 { animation-delay: 0.3s; } .hero-fade-4 { animation-delay: 0.42s; } .hero-fade-5 { animation-delay: 0.55s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-fade { animation: none; opacity: 1; transform: none; } .reveal { opacity: 1 !important; transform: none !important; } }

/* figures and animations */
.teaser .hero-body { padding-top: 0.5rem; padding-bottom: 1rem; }
.figure-video, .paper-figure img { width: 100%; height: auto; display: block; border-radius: 8px; background: #fff; }
.figure-video { cursor: pointer; }
.paper-figure { margin: 1.6rem 0 1.2rem 0; }
.paper-figure figcaption, .teaser-caption { font-style: normal !important; font-size: 0.95rem; color: #3B4556; line-height: 1.55; margin-top: 0.7rem; text-align: left; }
.paper-figure figcaption strong, .teaser-caption strong { color: var(--navy); }
.paper-figure.is-narrow img { max-width: 760px; margin: 0 auto; }
.anim-note { font-size: 0.85rem; color: var(--gray); text-align: right; margin-top: 0.2rem; }

/* section nav */
.section-nav { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.3rem; padding: 0.6rem 1rem; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); font-size: 0.98rem; }
.section-nav a { color: var(--navy); }
.section-nav a:hover { color: var(--blue-dark); }

/* sections */
.section { padding: 3.2rem 1.5rem; }
.section.is-light { background: var(--sand); }
.section .title.is-3 { margin-bottom: 1.4rem; }
.content h3.title.is-4 { margin-top: 2.2rem; margin-bottom: 0.9rem; }

/* tl;dr and abstract */
.tldr { background: var(--blue-tint); border-left: 4px solid var(--blue); border-radius: 8px; padding: 1rem 1.25rem; margin: 0.4rem 0 1rem 0; }
.tldr p { margin: 0; }
.tldr-label { font-weight: 700; color: var(--blue-dark); margin-right: 0.4rem; }
details.paper-details { border: 1px solid var(--rule); border-radius: 10px; background: #fff; margin: 1rem 0; }
details.paper-details > summary { cursor: pointer; padding: 0.75rem 1.1rem; font-weight: 600; color: var(--navy); list-style: none; }
details.paper-details > summary::-webkit-details-marker { display: none; }
details.paper-details > summary::before { content: '\25B8'; display: inline-block; margin-right: 0.55rem; transition: transform 0.2s ease; color: var(--blue); }
details.paper-details[open] > summary::before { transform: rotate(90deg); }
.details-body { padding: 0 1.25rem 1rem 1.25rem; }

/* math and takeaways */
.math-box { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 1rem; margin: 1rem 0; overflow-x: auto; }
.takeaway { border-left: 4px solid var(--navy); background: #fff; padding: 0.8rem 1.1rem; border-radius: 6px; margin-top: 1.3rem; box-shadow: var(--shadow); }

/* property cards */
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.4rem 0 0.4rem 0; }
.prop { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.prop h4 { font-size: 1.02rem !important; margin: 0 0 0.35rem 0 !important; color: var(--navy) !important; }
.prop p { font-size: 0.95rem; margin: 0 !important; }
.prop .icon { color: var(--blue); margin-right: 0.35rem; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 0.4rem 0; }
table.results-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
table.results-table th, table.results-table td { padding: 0.45rem 0.65rem; text-align: center; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.results-table th { background: var(--navy); color: #fff !important; font-weight: 600; }
table.results-table thead tr.sub th { background: var(--navy-soft); font-weight: 500; font-size: 0.88rem; }
table.results-table td:first-child, table.results-table th:first-child { text-align: left; }
table.results-table tr.ours-row td { background: var(--blue-tint); font-weight: 600; color: var(--navy); }
table.results-table tr.group-row td { background: #F4F5F7; font-style: italic; color: var(--gray); text-align: left; font-size: 0.88rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
table.results-table td.second { text-decoration: underline; text-underline-offset: 3px; }
table.results-table td.best { font-weight: 700; }
.table-note { font-size: 0.88rem; color: var(--gray); margin-top: 0.4rem; }

/* complex gallery */
.complex-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin: 1.4rem 0 0.8rem 0; }
.tabs-mini { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tab-btn { font-family: var(--serif); border: 1px solid var(--rule); background: #fff; color: var(--navy); border-radius: 999px; padding: 0.3rem 0.9rem; cursor: pointer; font-size: 0.93rem; }
.tab-btn:hover { border-color: var(--blue); }
.tab-btn.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.complex-pane { display: none; }
.complex-pane.is-active { display: block; }
.complex-card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.complex-card video { border-radius: 0; }
.complex-meta { padding: 0.9rem 1.2rem 1rem 1.2rem; border-top: 1px solid var(--rule); }
.complex-meta h4 { font-size: 1.05rem !important; margin: 0 0 0.3rem 0 !important; }
.complex-meta p { font-size: 0.95rem; margin: 0.25rem 0 0 0 !important; }
.metric-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.metric { background: var(--blue-tint); color: var(--navy); border-radius: 999px; padding: 0.12rem 0.7rem; font-size: 0.86rem; }
.metric.split { background: #F1F3F5; color: var(--gray); }
.legend-key { display: inline-block; width: 0.85em; height: 0.85em; border-radius: 3px; vertical-align: -0.05em; margin: 0 0.15em; }
.legend-key.epi { background: var(--red); }
.legend-key.heavy { background: var(--green); }
.legend-key.light { background: var(--cyan); }

/* bibtex */
.bibtex-header { display: flex; align-items: center; justify-content: space-between; }
.copy-bibtex-btn { font-family: var(--serif); background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 0.4rem 0.9rem; cursor: pointer; }
.copy-bibtex-btn:hover { background: var(--blue-dark); }
pre#bibtex-code { background: #F5F6F8; border: 1px solid var(--rule); border-radius: 10px; font-family: var(--mono); font-size: 0.86rem; color: var(--navy); white-space: pre-wrap; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* scroll to top */
.scroll-to-top { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: none; background: var(--navy); color: #fff; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; box-shadow: var(--shadow); z-index: 45; }
.scroll-to-top.visible { opacity: 0.9; pointer-events: auto; }

.footer { background: #fff; border-top: 1px solid var(--rule); padding: 2rem 1.5rem 2.5rem; font-size: 0.92rem; color: var(--gray); }
.footer a { color: var(--blue-dark); }

@media (max-width: 768px) {
  .publication-title { font-size: 3rem !important; }
  .section { padding: 2.4rem 1rem; }
  table.results-table { font-size: 0.85rem; }
}
