/* ============================================================
   EchoPilot — Project page
   Refined academic aesthetic: warm paper, restrained palette,
   serif headings, generous rhythm, tabular figures.
   ============================================================ */

:root {
  /* surfaces */
  --bg:           #fbfaf6;
  --bg-tint:      #f5f2ea;
  --surface:      #ffffff;
  --surface-alt:  #f7f5ef;

  /* ink */
  --ink:          #14161b;
  --text:         #262a31;
  --muted:        #6a6e77;
  --soft-muted:   #8b8e96;

  /* lines */
  --line:         #e7e3d8;
  --line-strong:  #d8d3c4;
  --hairline:     #efece3;

  /* accents */
  --accent:       #1f3a5f;   /* deep navy — restrained academic */
  --accent-hover: #122541;
  --accent-soft:  #eaeef5;
  --gold:         #8a6a1f;
  --gold-soft:    #f6efd6;
  --gold-line:    #d9bf73;

  /* "ours" row highlight (sage) */
  --ours-bg:      #f1f6ec;
  --ours-line:    #b9cca7;
  --ours-ink:     #2e5a30;

  /* type */
  --serif: "Newsreader", "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  /* metrics */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 27, 0.04), 0 1px 1px rgba(20, 22, 27, 0.03);
  --shadow-md: 0 4px 16px rgba(20, 22, 27, 0.06), 0 1px 3px rgba(20, 22, 27, 0.04);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* subtle paper texture via layered gradients */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 1200px 500px at 50% -10%, rgba(31, 58, 95, 0.05), transparent 60%),
    radial-gradient(ellipse 900px 400px at 100% 0%, rgba(138, 106, 31, 0.04), transparent 60%);
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
  border-bottom-color: currentColor;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* -------- layout containers -------- */

.container {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}
.container.narrow { width: min(780px, calc(100% - 40px)); }
.container.wide   { width: min(1160px, calc(100% - 40px)); }

/* -------- sticky top nav -------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}
.topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 0;
}
.topnav-brand:hover { color: var(--ink); border: 0; }
.topnav-brand img { width: 22px; height: 22px; object-fit: contain; }
.topnav-links {
  display: flex;
  gap: 22px;
}
.topnav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 0;
}
.topnav-links a:hover { color: var(--ink); border: 0; }
@media (max-width: 720px) {
  .topnav-links { display: none; }
}

/* -------- hero -------- */

.hero {
  position: relative;
  padding: 64px 0 28px;
  text-align: center;
}
.hero::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  margin: 38px auto 0;
  background: var(--line-strong);
}

.venue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 7px 14px 7px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.venue strong {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.publication-title {
  margin: 0 auto 24px;
  max-width: 1040px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.publication-title .title-em {
  font-style: italic;
  font-weight: 500;
}

.title-logo {
  display: inline-block;
  width: 44px;
  height: 44px;
  margin-right: 12px;
  object-fit: contain;
  vertical-align: -8px;
}

.authors {
  margin: 6px auto 12px;
  max-width: 1000px;
  color: var(--text);
  font-size: 17.5px;
  line-height: 1.7;
  text-wrap: balance;
}
.authors a {
  color: var(--text);
  border-bottom: 1px solid transparent;
}
.authors a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

sup {
  font-size: 65%;
  line-height: 0;
  color: var(--accent);
  font-weight: 600;
}

.affiliations {
  margin: 0 auto 10px;
  max-width: 1000px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: balance;
}

.corresponding {
  margin: 0;
  color: var(--soft-muted);
  font-size: 13.5px;
}
.corresponding a {
  color: var(--soft-muted);
  border-bottom: 1px dotted var(--soft-muted);
}
.corresponding a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* -------- link bar -------- */

.link-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.link-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.link-button.ghost {
  background: transparent;
  color: var(--ink);
}
.link-button.ghost:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.link-button.disabled {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--soft-muted);
  cursor: default;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
}
.link-button.disabled:hover {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--soft-muted);
  transform: none;
  box-shadow: none;
}
.link-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* -------- sections -------- */

.section {
  padding: 56px 0;
  scroll-margin-top: 68px;
}
.section + .section {
  border-top: 1px solid var(--hairline);
}
.teaser-section {
  padding-top: 20px;
  border-top: 0 !important;
}

.eyebrow {
  display: block;
  margin: 0 0 14px;
  color: var(--soft-muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow.center { text-align: center; }

h2 {
  margin: 0 0 22px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
h2.center { text-align: center; }

h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

p { margin: 0 0 16px; }
.text p:last-child { margin-bottom: 0; }
.text p { color: var(--text); }
.text strong { color: var(--ink); font-weight: 600; }

/* -------- figures -------- */

.figure {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-md);
}
.figure.clean {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.figure-spaced { margin-top: 36px; }
.figure.radar  { width: min(680px, 100%); }

.caption {
  max-width: 880px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  text-align: center;
}
.caption strong { color: var(--text); font-weight: 600; }

/* -------- TL;DR -------- */

.tldr {
  margin: 0;
  padding: 20px 26px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.tldr strong {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* -------- section lead -------- */

.section-lead {
  max-width: 820px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.65;
  text-align: center;
}

/* -------- claims grid -------- */

.claims {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.claims > div {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.claims > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.claims p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* -------- tables -------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.results-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.ablation-table { min-width: 1180px; }

.results-table th,
.results-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--hairline);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  padding-left: 18px;
}
.results-table td:last-child,
.results-table th:last-child {
  border-right: 0;
  padding-right: 18px;
}

.results-table thead th {
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--line-strong);
}
.results-table thead tr:first-child th {
  border-bottom: 1px solid var(--line);
}

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

.results-table .group-row td {
  background: var(--bg-tint);
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding-left: 18px;
}

.results-table .external td {
  background: #fbfaf5;
  color: var(--text);
}

.results-table .ours td {
  background: var(--ours-bg);
  border-top: 1px solid var(--ours-line);
  border-bottom: 1px solid var(--ours-line);
  color: var(--text);
}
.results-table .ours td:first-child {
  font-weight: 700;
  color: var(--ours-ink);
}
.results-table .ours td:first-child::before {
  content: "★ ";
  color: var(--gold);
  margin-right: 2px;
}

.results-table strong {
  color: var(--ours-ink);
  font-weight: 700;
}

/* -------- download list -------- */

.download-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.download-list li {
  position: relative;
  margin: 6px 0;
  padding-left: 22px;
}
.download-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
.download-list a {
  font-family: var(--mono);
  font-size: 14px;
}

/* -------- code / bibtex -------- */

pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
code { font-family: var(--mono); }

.bibtex-wrap {
  position: relative;
}
.bibtex-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.bibtex-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.bibtex-copy svg { width: 13px; height: 13px; }

/* -------- footer -------- */

footer {
  padding: 32px 0 44px;
  border-top: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}
footer p { margin: 0; }
footer a { color: var(--muted); border-bottom: 1px dotted var(--muted); }
footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* -------- responsive -------- */

@media (max-width: 900px) {
  .claims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .publication-title {
    font-size: 30px;
    line-height: 1.18;
  }
  .title-logo {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    vertical-align: -6px;
  }
  .authors { font-size: 16px; }
  .affiliations { font-size: 14px; }
  .link-button {
    min-width: 104px;
    height: 40px;
    padding: 0 14px;
    font-size: 13.5px;
  }
  .section { padding: 40px 0; }
  h2 { font-size: 26px; }
  .tldr { padding: 16px 18px; font-size: 16px; }
  .claims {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .eyebrow { font-size: 11px; letter-spacing: 0.15em; }
}
