/* ==========================================================
   Paper pages · long-form reading in the site's lidar-lab palette
   ========================================================== */

:root {
  --bg: #04080c;
  --bg2: #071019;
  --panel: #0a1520;
  --line: #12283a;
  --txt: #d7e6ee;
  --txt-dim: #8aa3b3;
  --acc: #45ffb0;
  --acc2: #4fc3ff;
  --mono-stack: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--acc2); text-decoration: none; }
a:hover { color: var(--acc); text-decoration: underline; }
.mono { font-family: var(--mono-stack); }
::selection { background: var(--acc); color: #03130b; }

/* ---- nav ---- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 26px;
  background: rgba(4, 8, 12, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav .brand { color: var(--acc); font-size: 14px; letter-spacing: .06em; }
.topnav .links { display: flex; gap: 22px; }
.topnav .links a { color: var(--txt-dim); font-size: 14px; }
.topnav .links a:hover { color: var(--acc); text-decoration: none; }

/* ---- header ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 0 26px; }

.paper-head { max-width: 900px; padding: 64px 0 40px; }
.kicker { color: var(--acc); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.paper-head h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 22px; }
.authors { font-size: 17px; margin-bottom: 10px; }
.authors a[rel=author] { color: var(--txt); border-bottom: 1px dashed var(--acc); }
.au { white-space: nowrap; }
.au sup { color: var(--txt-dim); font-size: 11px; margin-left: 1px; }
.orcid {
  display: inline-block; font: 700 9px/15px var(--mono-stack);
  width: 16px; height: 16px; border-radius: 50%; text-align: center;
  background: #a6ce39; color: #fff !important; vertical-align: 2px; text-decoration: none !important;
}
.affils { list-style: none; color: var(--txt-dim); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.affils sup { color: var(--acc); }
.venue { color: var(--txt-dim); font-size: 15px; margin-bottom: 26px; }
.venue em { color: var(--txt); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; font-family: var(--mono-stack); font-size: 13px; letter-spacing: .05em;
  padding: 11px 20px; border-radius: 4px; text-decoration: none !important; transition: all .2s;
}
.btn-solid { background: var(--acc); color: #03130b !important; }
.btn-solid:hover { box-shadow: 0 0 22px rgba(69,255,176,.45); }
.btn-ghost { border: 1px solid var(--line); color: var(--txt) !important; }
.btn-ghost:hover { border-color: var(--acc); color: var(--acc) !important; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-bottom: 80px; }

.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 14px; }
.toc summary { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; margin-bottom: 10px; }
.toc ol { list-style: none; }
.toc li { margin: 6px 0; line-height: 1.4; }
.toc ol ol { padding-left: 12px; border-left: 1px solid var(--line); margin: 6px 0 10px; }
.toc ol ol li { font-size: 13px; }
.toc a { color: var(--txt-dim); }
.toc a:hover { color: var(--acc); text-decoration: none; }

.paper { max-width: 780px; min-width: 0; }

/* ---- panels: abstract, glance, cite ---- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 26px 28px; margin-bottom: 28px;
}
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.note { color: var(--txt-dim); font-size: 14px; margin-bottom: 14px; }
.glance ul { padding-left: 20px; }
.glance li { margin-bottom: 8px; }
.glance li::marker { color: var(--acc); }
.kw { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kw .mono { color: var(--txt-dim); font-size: 12px; margin-right: 4px; }
.chip { font-family: var(--mono-stack); font-size: 12px; border: 1px solid var(--line); border-radius: 3px; padding: 3px 9px; color: var(--acc2); }

details.cite { border-top: 1px solid var(--line); }
details.cite:last-of-type { border-bottom: 1px solid var(--line); }
details.cite summary { cursor: pointer; padding: 11px 0; font-family: var(--mono-stack); font-size: 14px; color: var(--txt); }
details.cite summary:hover { color: var(--acc); }
.cite-body { padding-bottom: 14px; }
.cite-body pre {
  font-family: var(--mono-stack); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; color: var(--txt);
}
.cite-actions { display: flex; gap: 16px; align-items: center; margin-top: 8px; font-family: var(--mono-stack); font-size: 12px; }
button.copy {
  font: inherit; color: var(--bg); background: var(--acc2); border: 0; border-radius: 3px; padding: 5px 12px; cursor: pointer;
}
button.copy:hover { background: var(--acc); }

/* ---- full text ---- */
.fulltext h2, #references h2, #authors-bios h2 {
  font-size: 26px; line-height: 1.3; margin: 56px 0 18px; padding-top: 18px; border-top: 1px solid var(--line);
}
.fulltext h3 { font-size: 20px; margin: 36px 0 12px; }
.fulltext h4 { font-size: 17px; margin: 28px 0 10px; color: var(--acc2); }
.header-section-number { color: var(--acc); font-family: var(--mono-stack); font-weight: 500; margin-right: 10px; }
.fulltext p { margin-bottom: 16px; }
.fulltext ul, .fulltext ol { margin: 0 0 16px 24px; }
.fulltext li { margin-bottom: 6px; }
.fulltext strong { color: #fff; }
.citation a { white-space: nowrap; }
.footnotes { font-size: 14px; color: var(--txt-dim); }

figure.fig, figure.algorithm, .tbl { margin: 30px 0; }
figure.fig img {
  display: block; width: 100%; height: auto; max-height: 640px; object-fit: contain;
  background: #fff; border-radius: 6px; padding: 10px;
}
figure figcaption {
  font-size: 14px; color: var(--txt-dim); margin-top: 10px; line-height: 1.55; text-align: left; caption-side: top;
}
figure figcaption b { color: var(--acc); font-family: var(--mono-stack); font-weight: 500; }
figure.tbl > figcaption { margin: 0 0 10px; }

.tbl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.tbl table { border-collapse: collapse; font-size: 13.5px; line-height: 1.5; min-width: 640px; width: 100%; }
.tbl th, .tbl td { padding: 9px 12px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: var(--bg2); color: var(--acc); font-family: var(--mono-stack); font-size: 12px; font-weight: 500; position: sticky; top: 0; }
.tbl tbody tr:hover td { background: rgba(79,195,255,.05); }

.algorithm { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.algorithm figcaption { margin: 0 0 10px; }
ol.algo { margin: 0 0 0 28px; font-size: 15px; }
ol.algo li { padding-left: calc(var(--d) * 22px); margin-bottom: 4px; }
ol.algo li::marker { color: var(--txt-dim); font-family: var(--mono-stack); font-size: 12px; }
.algo .sc { font-variant: small-caps; }
.algo .cm { color: var(--txt-dim); margin-left: 10px; }

span.math.display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
mjx-container[display="true"] { max-width: 100%; min-width: 0 !important; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
/* long inline formulas scroll in place instead of widening the page on phones */
span.math.inline { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom; }

/* ---- references ---- */
.refs { font-size: 14px; line-height: 1.55; color: var(--txt-dim); }
.refs .csl-entry { display: grid; grid-template-columns: 52px 1fr; gap: 4px; padding: 7px 0; border-bottom: 1px solid rgba(18,40,58,.6); }
.refs .csl-entry:target { background: rgba(69,255,176,.08); }
.refs .csl-left-margin { font-family: var(--mono-stack); color: var(--acc); font-size: 12.5px; }
.refs a { word-break: break-word; }

/* ---- bios ---- */
.bio { display: grid; grid-template-columns: 120px 1fr; gap: 20px; margin-bottom: 24px; font-size: 15px; color: var(--txt-dim); }
.bio img { width: 120px; height: 150px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.bio strong { color: var(--txt); }

#about-this-page { margin-top: 48px; font-size: 14.5px; color: var(--txt-dim); }
#about-this-page p + p { margin-top: 10px; }

.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 22px 26px; border-top: 1px solid var(--line); color: var(--txt-dim); font-size: 12px;
}

/* ---- profile page ---- */
.profile table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 10px 0 24px; display: block; overflow-x: auto; }
.profile th, .profile td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.profile th { color: var(--acc); font-family: var(--mono-stack); font-size: 12px; font-weight: 500; background: var(--bg2); }
.profile h2:first-child { margin-top: 8px; }
.profile p, .profile li { overflow-wrap: anywhere; }

/* ---- project pages ---- */
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; margin-top: 14px; font-size: 15px; }
.facts dt { color: var(--txt-dim); font-family: var(--mono-stack); font-size: 12px; padding-top: 3px; }
.facts dd { margin: 0; }
.project section > h2 { font-size: 22px; margin: 40px 0 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.project .kw { margin-top: 36px; }
.project .panel > h2 { margin-top: 0; padding-top: 0; border-top: 0; font-size: 20px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.video { margin: 0; }
.video button.yt, .video iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #000; padding: 0; cursor: pointer; }
.video button.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s; }
.video button.yt:hover img { opacity: 1; }
.video .play { position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 10px; background: rgba(4,8,12,.8); border: 1px solid var(--acc); }
.video .play::after { content: ""; position: absolute; left: 26px; top: 13px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--acc); }
.video figcaption { margin-top: 8px; font-size: 14px; color: var(--txt-dim); }

/* ---- publications index ---- */
.publist { list-style: none; max-width: 900px; padding-bottom: 80px; }
.publist li { display: grid; grid-template-columns: 70px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.publist .yr { color: var(--acc); font-size: 14px; padding-top: 4px; }
.publist h2 { font-size: 20px; line-height: 1.35; margin-bottom: 6px; }
.publist h2 a { color: var(--txt); }
.publist h2 a:hover { color: var(--acc); }
.publist .by { font-size: 15px; margin-bottom: 4px; }
.publist .src, .publist .more { font-size: 13px; color: var(--txt-dim); margin-bottom: 10px; }
.publist p { color: var(--txt-dim); font-size: 15px; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 28px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
  .toc details:not([open]) summary { margin-bottom: 0; }
}

@media (max-width: 600px) {
  .page { padding: 0 16px; }
  .topnav { padding: 12px 16px; }
  .topnav .brand { font-size: 13px; }
  .topnav .links { gap: 14px; }
  .topnav .links a { font-size: 13px; }
  .paper-head { padding: 40px 0 28px; }
  .panel { padding: 20px 18px; }
  .au { white-space: normal; }
  .bio { grid-template-columns: 1fr; }
  .refs .csl-entry { grid-template-columns: 44px 1fr; }
  .publist li { grid-template-columns: 1fr; gap: 4px; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: 8px; }
  .fulltext h2 { font-size: 22px; }
  figure.fig img { padding: 6px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  :root { --bg: #fff; --panel: #fff; --line: #ccc; --txt: #000; --txt-dim: #333; --acc: #000; --acc2: #00468c; }
  .topnav, .toc, .actions, .cite-actions, .footer { display: none; }
  .layout { display: block; }
  .fulltext strong { color: #000; }
}
