/* ============================================================
   OAQ-SR — project page
   ============================================================ */

:root {
  --bg:        #090b10;
  --bg-2:      #0e1118;
  --surface:   #141824;
  --surface-2: #1b2130;
  --line:      #262d3d;
  --line-soft: #1c222f;

  --text:      #e9ecf3;
  --text-2:    #b3bccd;
  --muted:     #7b8699;

  --dense:     #ff7a4d;   /* dense region / "ours" */
  --dense-dim: #b8532f;
  --outlier:   #4cc2ff;   /* outlier region */
  --good:      #6ee7a8;
  --gold:      #ffc861;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--outlier); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------- nav --------- */
nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(9, 11, 16, .78);
  border-bottom: 1px solid var(--line-soft);
}
nav .wrap { display: flex; align-items: center; gap: 8px; height: 60px; }
nav .brand {
  font-weight: 700; letter-spacing: -.02em; color: var(--text);
  font-size: 15px; margin-right: auto; display: flex; align-items: center; gap: 9px;
}
nav .brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--dense); box-shadow: 0 0 14px var(--dense);
}
nav .links { display: flex; gap: 4px; }
nav .links a {
  color: var(--text-2); font-size: 14px; padding: 7px 12px;
  border-radius: 8px; text-decoration: none; transition: .18s;
}
nav .links a:hover { color: var(--text); background: var(--surface); }
@media (max-width: 820px) { nav .links { display: none; } }

/* ---------------------------------------------------------- hero -------- */
header.hero { position: relative; padding: 46px 0 40px; overflow: hidden; }
header.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 780px;
  background:
    radial-gradient(46% 52% at 22% 30%, rgba(255,122,77,.20), transparent 68%),
    radial-gradient(40% 46% at 78% 22%, rgba(76,194,255,.17), transparent 66%),
    radial-gradient(50% 40% at 50% 70%, rgba(110,231,168,.07), transparent 70%);
  filter: blur(28px);
  animation: drift 22s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  header.hero::before { animation: none; }
  html { scroll-behavior: auto; }
}
header.hero .wrap { position: relative; }

.venue {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--dense); border: 1px solid rgba(255,122,77,.32);
  background: rgba(255,122,77,.07);
  padding: 5px 13px; border-radius: 999px; margin-bottom: 18px;
}

h1.title {
  font-family: var(--serif);
  /* sized so the full title sits on a single line at the container width */
  font-size: clamp(1.32rem, 2.98vw, 2.2rem);
  line-height: 1.12; letter-spacing: -.022em; font-weight: 600;
  margin: 0 0 16px; max-width: none; white-space: nowrap;
}
@media (max-width: 620px) {
  /* below this width a single line would be unreadably small */
  h1.title { white-space: normal; font-size: clamp(1.5rem, 6.4vw, 2rem); line-height: 1.14; }
}
h1.title .accent {
  background: linear-gradient(100deg, var(--dense) 5%, var(--gold) 55%, var(--outlier) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.authors { font-size: .98rem; margin: 0 0 4px; color: var(--text); }
.authors a { color: var(--text); border-bottom: 1px solid transparent; }
.authors a:hover { border-bottom-color: var(--dense); text-decoration: none; }
.authors sup { color: var(--dense); font-size: .72em; }
.affil { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }

.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-size: 14.5px; font-weight: 500;
  text-decoration: none; transition: .18s ease;
}
.btn:hover { background: var(--surface-2); border-color: #3a4459; transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 17px; height: 17px; opacity: .85; }
.btn.primary {
  background: linear-gradient(135deg, var(--dense), #ff9f6b);
  border-color: transparent; color: #1a0c05; font-weight: 650;
}
.btn.primary:hover { filter: brightness(1.08); }

/* ---------------------------------------------------------- stats ------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; margin: 34px 0 0;
}
.stats div { background: var(--bg-2); padding: 17px 18px; }
.stats b {
  display: block; font-family: var(--mono); font-size: 1.5rem;
  letter-spacing: -.03em; color: var(--dense); font-weight: 600; line-height: 1.15;
}
.stats span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------- sections ---- */
section { padding: 76px 0; border-top: 1px solid var(--line-soft); }
section.plain { border-top: none; }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .17em;
  text-transform: uppercase; color: var(--dense); margin-bottom: 14px;
}
h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem); letter-spacing: -.02em;
  line-height: 1.15; margin: 0 0 18px;
}
h3 { font-size: 1.12rem; font-weight: 620; margin: 0 0 10px; letter-spacing: -.01em; }
p { color: var(--text-2); }
p.lead { font-size: 1.09rem; color: var(--text); }

figure { margin: 30px 0 0; }
figure img { width: 100%; display: block; border-radius: var(--radius-sm); }
figcaption { color: var(--muted); font-size: 13.5px; margin-top: 12px; line-height: 1.55; }
figcaption b { color: var(--text-2); font-weight: 600; }

.card {
  background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 26px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.finding { display: flex; gap: 16px; align-items: flex-start; }
.finding .num {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 14px;
  background: rgba(255,122,77,.11); color: var(--dense); border: 1px solid rgba(255,122,77,.25);
}

/* ------------------------------------------------- before/after slider -- */
.ba {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  user-select: none; touch-action: none; cursor: ew-resize; background: #000;
}
.ba img { display: block; width: 100%; }
.ba .after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.ba .after img { width: 100%; height: 100%; object-fit: cover; }
.ba .handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.6); pointer-events: none;
}
.ba .handle::after {
  content: "⟷"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: #111; display: grid; place-items: center;
  font-size: 15px; box-shadow: 0 3px 14px rgba(0,0,0,.5);
}
.ba .tag {
  position: absolute; top: 10px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px;
  border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; pointer-events: none;
}
.ba .tag.l { left: 10px; }
.ba .tag.r { right: 10px; }

/* ------------------------------------------------- results explorer ----- */
.explorer { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.explorer .bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface);
}
.explorer .bar .label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  font: inherit; font-size: 13px; padding: 6px 13px; border-radius: 999px;
  cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--text); border-color: #3a4459; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chip.ours[aria-pressed="true"] { background: var(--dense); border-color: var(--dense); color: #1a0c05; }

.stage {
  position: relative; background: #000; display: grid; place-items: center;
  min-height: 300px; overflow: hidden;
}
.stage img { max-width: 100%; max-height: 70vh; display: block; }
.stage .badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  background: rgba(0,0,0,.7); border: 1px solid rgba(255,255,255,.16);
  padding: 6px 11px; border-radius: 7px; color: #fff; pointer-events: none;
}
.stage .hint {
  position: absolute; right: 14px; bottom: 14px; z-index: 3;
  font-size: 11.5px; color: rgba(255,255,255,.6); pointer-events: none;
}
.lens {
  position: absolute; width: 190px; height: 190px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85); box-shadow: 0 6px 26px rgba(0,0,0,.7);
  pointer-events: none; display: none; z-index: 4;
  background-repeat: no-repeat;
}
.stage.zooming .lens { display: block; }

.thumbs { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-top: 1px solid var(--line-soft); }
.thumbs button {
  flex: none; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: none; line-height: 0; transition: .15s;
}
.thumbs button img { width: 92px; height: 62px; object-fit: cover; opacity: .55; transition: .15s; }
.thumbs button:hover img { opacity: .85; }
.thumbs button[aria-pressed="true"] { border-color: var(--dense); }
.thumbs button[aria-pressed="true"] img { opacity: 1; }

/* ---------------------------------------------------------- tables ------ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 26px; }
table {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
  font-variant-numeric: tabular-nums; min-width: 620px;
}
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line-soft); }
th:first-child, td:first-child { text-align: left; }
th {
  font-size: 11.5px; font-family: var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  border-bottom-color: var(--line);
}
tbody tr:hover { background: rgba(255,255,255,.02); }
tr.ours { background: rgba(255,122,77,.07); }
tr.ours td { color: var(--text); font-weight: 600; border-bottom-color: rgba(255,122,77,.2); }
tr.ours td:first-child { color: var(--dense); }
tr.fp td { color: var(--muted); font-style: italic; }
tr.group td { padding-top: 22px; border-bottom: 0; color: var(--text); font-weight: 600; font-size: 13px; }
td.best { color: var(--good); }

/* ---------------------------------------------------------- bibtex ------ */
.bibtex { position: relative; }
.bibtex pre {
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
  color: var(--text-2); line-height: 1.7; margin: 0;
}
.copy {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.copy:hover { color: var(--text); border-color: #3a4459; }

/* ---------------------------------------------------------- footer ------ */
footer {
  border-top: 1px solid var(--line-soft); padding: 40px 0 60px;
  color: var(--muted); font-size: 13.5px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------- reveal ------ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

code.inline {
  font-family: var(--mono); font-size: .9em; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 6px; color: var(--dense);
}
