/* CompassAD Project Page — Restrained Academic Editorial
 * White base · multi-color editorial accents (blue/red/gold/cyan/purple)
 * Reference: name-that-part.github.io structure + editorial typographic polish
 */

/* ===== Font Feature Settings ===== */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.font-display {
  font-feature-settings: "kern", "liga";
  letter-spacing: -0.015em;
}
.font-serif {
  font-feature-settings: "kern", "liga", "onum";
}
.smallcaps {
  font-variant: small-caps;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-feature-settings: "smcp", "c2sc", "kern";
}
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ===== Drop cap ===== */
.drop-cap::first-letter {
  font-family: 'IBM Plex Serif', 'Source Serif 4', Georgia, serif;
  font-weight: 700;
  font-size: 4em;
  line-height: 0.9;
  float: left;
  margin: 0.05em 0.12em 0 -0.02em;
  color: #1E40AF;
  font-feature-settings: "ss01";
}

/* ===== Hairline divider ===== */
.hairline {
  border: none;
  border-top: 1px solid rgba(10, 10, 10, 0.10);
  margin: 4rem auto;
  max-width: 240px;
}

/* ===== Section number ornament ===== */
.section-number {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #B89968;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}
.section-number::before {
  content: "";
  display: inline-block;
  width: 2.5rem;
  height: 1.5px;
  background-color: #B89968;
}

/* ===== Author hover — refined left-to-right reveal ===== */
.author-link {
  position: relative;
  display: inline-block;
  color: #1E40AF;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 1px 4px;
  background-image: linear-gradient(90deg, #1E40AF, #1E40AF);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.45s cubic-bezier(0.2, 0.85, 0.25, 1),
              color 0.3s ease,
              transform 0.3s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.author-link:hover {
  color: #0A0A0A;
  background-size: 100% 1.5px;
  transform: translateY(-1px);
}
.author-link.no-link {
  cursor: default;
  background-image: none;
}
.author-link.no-link:hover {
  transform: none;
  color: #1E40AF;
}
.author-link sup {
  font-size: 0.7em;
  vertical-align: super;
}

/* ===== Refined academic link buttons ===== */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid rgba(10, 10, 10, 0.22);
  border-radius: 6px;
  color: #0A0A0A;
  background: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.005em;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.02);
}
.btn-link:hover {
  border-color: #1E40AF;
  color: #1E40AF;
  background: rgba(30, 64, 175, 0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(30, 64, 175, 0.18);
}
.btn-link svg { opacity: 0.7; }
.btn-link:hover svg { opacity: 1; }

/* ===== Hero subtitle subtle gold underline accent ===== */
.hero-rule {
  display: block;
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #B89968 30%, #B89968 70%, transparent);
  margin: 0 auto;
}

/* ===== Stats — large numerals ===== */
.stat-num {
  font-family: 'IBM Plex Serif', 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ===== Results table ===== */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: #1A1A1A;
}
.results-table th,
.results-table td {
  padding: 0.7rem 1rem;
  text-align: right;
  border-bottom: 1px solid rgba(10, 10, 10, 0.06);
}
.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
}
.results-table thead th {
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B7280;
  border-bottom: 1.5px solid #0A0A0A;
  background-color: #FFFFFF;
  position: sticky;
  top: 56px;
  z-index: 5;
}
.results-table .row-split td {
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #B89968;
  padding-top: 1.6rem;
  padding-bottom: 0.6rem;
  text-align: left !important;
  border-bottom: none;
}
.results-table .ours {
  background-color: rgba(199, 62, 29, 0.04);
  border-left: 2px solid #C73E1D;
}
.results-table .ours td:first-child {
  position: relative;
}
.results-table .ours td {
  font-weight: 700;
  color: #0A0A0A;
}
.best { color: #C73E1D; font-weight: 700; }
.second { text-decoration: underline; text-decoration-color: rgba(184, 153, 104, 0.6); text-underline-offset: 3px; }

/* ===== Method block accent borders (cyan ICI / purple BCR) ===== */
.ici-accent { border-top: 3px solid #5DCEC8; }
.bcr-accent { border-top: 3px solid #9B8FD8; }
.ici-tag {
  background: rgba(93, 206, 200, 0.12);
  color: #0E8D86;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.bcr-tag {
  background: rgba(155, 143, 216, 0.14);
  color: #6952B8;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* ===== Pipeline diagram ===== */
.pipeline-step {
  position: relative;
  flex: 1;
  padding: 1.5rem;
  background: #FFFFFF;
  border: 1px solid rgba(10, 10, 10, 0.10);
  border-radius: 4px;
  text-align: left;
}
.pipeline-step + .pipeline-step::before {
  content: "→";
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #B89968;
  font-size: 1.5rem;
  font-weight: 300;
}
@media (max-width: 768px) {
  .pipeline-step + .pipeline-step::before {
    content: "↓";
    left: 50%;
    top: -1.25rem;
    transform: translateX(-50%);
  }
}

/* ===== BibTeX block ===== */
.bibtex-block {
  position: relative;
  background-color: #FAFAFA;
  color: #0A0A0A;
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 6px;
  padding: 1.75rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}
.bibtex-block pre { color: #0A0A0A; }
.bibtex-block .key { color: #1E40AF; }
.bibtex-block .value { color: #6B6256; }

.copy-btn {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  padding: 0.32rem 0.7rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #FFFFFF;
  color: #1E40AF;
  border: 1px solid #1E40AF;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover {
  background-color: #1E40AF;
  color: #FFFFFF;
}
.copy-btn.copied {
  background-color: #C73E1D;
  border-color: #C73E1D;
  color: #FFFFFF;
}

/* ===== Scroll-to-top ===== */
.scroll-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 40px;
  height: 40px;
  background-color: #FFFFFF;
  color: #0A0A0A;
  border: 1px solid rgba(10, 10, 10, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 40;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover {
  border-color: #1E40AF;
  color: #1E40AF;
}

/* ===== Selection ===== */
::selection { background-color: rgba(30, 64, 175, 0.18); color: #0A0A0A; }

/* ===== Print ===== */
@media print {
  .scroll-top, nav { display: none !important; }
}

/* ===== Reveal (subtle) ===== */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Figure containers ===== */
.figure-frame {
  background: #FFFFFF;
  border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: 6px;
  overflow: hidden;
  padding: 0.5rem;
}
.figure-frame img { display: block; width: 100%; height: auto; }
