/* ========================================================
   PACG-HOI Project Page Styles
   Theme: Academic Nerfies base + red/green accents
   ======================================================== */

:root {
  /* --- method-semantic colors (DO NOT theme): green = Ours/ACG, red = Baseline --- */
  --accent-green: #2ecc71;
  --accent-green-dark: #27ae60;
  --accent-red: #e74c3c;
  --accent-red-dark: #c0392b;
  /* --- brand accent (indigo; kept distinct from the method green) --- */
  --brand: #6155d6;
  --brand-dark: #4a3fc0;
  --brand-grad: #9b7cf0;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #ffffff;
  --paper-soft: #f7f9fa;
  --border: #e2e6ea;
}

body {
  font-family: 'Noto Sans', 'Google Sans', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.publication-title {
  font-family: 'Castoro', 'Google Sans', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.method-name {
  background: linear-gradient(120deg, var(--brand-dark) 0%, var(--brand-grad) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.accent-brand { color: var(--brand-dark); font-weight: 600; }
.accent-red   { color: var(--accent-red-dark);   font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 1rem 1rem 1rem;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-soft) 100%);
}
.hero .publication-authors {
  margin-top: 1.5rem;
  color: var(--ink-soft);
}
.hero .publication-authors a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--brand);
  transition: color 0.2s, border-color 0.2s;
}
.hero .publication-authors a:hover {
  color: var(--brand-dark);
  border-bottom-color: var(--brand-dark);
}

.author-block {
  margin: 0 0.4rem;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem auto 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.venue-text { color: var(--ink); }
.oral-badge {
  background: var(--accent-red);
  color: white;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.publication-links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}
.publication-links .button.is-dark {
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  position: relative;
}
.publication-links .button.is-dark:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 63, 192, 0.22);
}
.coming-soon-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
  background: var(--accent-red);
  color: white;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Not-yet-available links: rendered as inert, greyed-out buttons. */
.external-link.is-unavailable {
  background: #9aa3ad !important;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}
/* "to be determined" tag — softer than soon, promises no timeline. */
.tbd-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Teaser ---------- */
.hero.teaser {
  padding: 1rem 1rem 2rem 1rem;
  background: var(--paper);
}
.teaser-container {
  text-align: center;
  padding: 1rem 0;
}
/* ---------- Teaser (interactive viewer) ---------- */
.hero.teaser .hero-body { padding: 1.5rem 0 0; }
.teaser-eyebrow {
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-bottom: 1.25rem;
}
.teaser-viewer { min-height: 360px; }
.teaser-image {
  max-width: 100%;
  border-radius: 8px;
}
.hero.teaser .subtitle {
  margin-top: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.dnote {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Sections ---------- */
.section { padding: 3.5rem 1.5rem; }
.section-light { background: var(--paper-soft); }
.title.is-3 {
  font-family: 'Castoro', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
  white-space: nowrap;
}
.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand-grad) 100%);
  border-radius: 2px;
}
.section-subtitle {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Method ---------- */
.method-figure {
  text-align: center;
  margin: 1rem 0;
}
.method-img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}

.method-figure figcaption {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.method-detail-row {
  margin-top: 2rem;
  align-items: center;
}
.method-detail-row h3.title {
  font-family: 'Castoro', serif;
}

.equation-block {
  background: var(--paper);
  border-left: 4px solid var(--brand);
  padding: 1.25rem 1.5rem;
  margin: 2rem auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.equation-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.equation {
  /* math rendered by KaTeX; this just controls spacing/overflow */
  margin: 0.5rem 0;
  overflow-x: auto;
}
.equation-note {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Legend pills ---------- */
.legend-baseline, .legend-ours, .legend-gt {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}
.legend-baseline { background: rgba(231, 76, 60, 0.12);  color: var(--accent-red-dark); }
.legend-ours     { background: rgba(46, 204, 113, 0.15); color: var(--accent-green-dark); }
.legend-gt       { background: rgba(0, 0, 0, 0.08);      color: var(--ink); }

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  background: var(--paper);
  margin-top: 1rem;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  table-layout: auto;
  display: table; /* guard against Bulma/other rules forcing block/flex on the table */
}
/* Hard reset every cell's box so external CSS (Bulma .table td, etc.) cannot
   shift rows or collapse columns. vertical-align middle keeps grouped labels aligned. */
.results-table tr { display: table-row; }
.results-table thead { display: table-header-group; }
.results-table tbody { display: table-row-group; }
.results-table th,
.results-table td {
  display: table-cell;
  vertical-align: middle;
  box-sizing: border-box;
}
.results-table thead {
  background: var(--ink);
  color: #ffffff;
}
.results-table thead th,
.results-table thead td {
  color: #ffffff !important;
}
.results-table thead th sub,
.results-table thead th sup {
  color: #ffffff;
}
.results-table th {
  padding: 0.75rem 0.85rem;
  text-align: center !important;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.results-table td {
  padding: 0.7rem 0.85rem;
  text-align: center !important;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.results-table td.label,
.results-table th:first-child,
.results-table th:nth-child(2) {
  text-align: left !important;
}
.results-table td.num {
  text-align: center !important;
  font-variant-numeric: tabular-nums;
}
.results-table td.dataset { font-weight: 700; white-space: nowrap; }
/* group separator (replaces rowspan grouping) */
.results-table tbody tr.group-start td { border-top: 2px solid var(--ink); }
.results-table tbody tr.group-start:first-child td { border-top: none; }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table .ours-row {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.06) 0%, rgba(46, 204, 113, 0.02) 100%);
}
.results-table .ours-row td { font-weight: 500; }
.table-caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}
.caption-note {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  opacity: 0.8;
}

/* ---------- Metric legend ---------- */
.metric-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1.75rem;
  max-width: 760px;
  margin: 1.25rem auto 0;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.metric-legend > div {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.86rem;
  line-height: 1.4;
}
.metric-legend dt {
  flex: 0 0 auto;
  min-width: 3.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--ink);
}
.metric-legend dd {
  margin: 0;
  color: var(--ink-soft);
}
.metric-legend .ml-dir {
  color: var(--brand-dark);
  font-weight: 600;
  white-space: nowrap;
}
.metric-note {
  max-width: 760px;
  margin: 0.6rem auto 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
@media screen and (max-width: 600px) {
  .metric-legend { grid-template-columns: 1fr; }
}

/* ---------- BibTeX ---------- */
pre.bibtex {
  background: var(--ink);
  color: #f0f0f0;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  border-left: 4px solid var(--brand);
}
pre.bibtex code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--paper-soft);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1rem;
}
.acknowledgement {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.template-credit {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}
.template-credit a {
  color: var(--brand-dark);
  text-decoration: none;
}
.template-credit a:hover { text-decoration: underline; }

/* ---------- Transport bar (shared viewer control) ---------- */
.transport-bar { border-radius: 999px; }

/* ---------- Responsive ---------- */
@media screen and (max-width: 768px) {
  .publication-title { font-size: 1.6rem; }
  .author-block { display: inline-block; margin: 0.2rem 0.3rem; }
  .section { padding: 2.5rem 1rem; }
  .results-table { font-size: 0.78rem; min-width: 540px; } /* container scrolls */
  .results-table th, .results-table td { padding: 0.5rem 0.4rem; }
}

@media screen and (max-width: 600px) {
  /* stack the side-by-side comparison panels instead of crushing them */
  .cf-row { flex-direction: column !important; align-items: center !important; }
  .cf-col { flex: none !important; width: 100% !important; max-width: 360px; }
  .cf-divider { display: none !important; }
  /* the reference→judged-pair flow stacks vertically; arrow points down */
  .cf-ref { flex: none !important; width: 100% !important; max-width: 360px; }
  .cf-judge { flex: none !important; width: 100% !important; max-width: 360px; }
  .cf-arrow { flex: none !important; transform: rotate(90deg); margin: 2px 0; }
  /* once the transport controls wrap to two rows, a pill radius looks broken */
  .transport-bar { border-radius: 16px !important; }
}
