/* MD Azizul Hakim: site styles. White page, maroon and green accents. Always light. */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --text: #1f1f1f;
  --muted: #5c5c5c;
  --faint: #9a9a9a;
  --line: #e6e6e6;
  --soft: #fbf3f1;
  --maroon: #8e1b1b;         /* venues, labels, counts */
  --maroon-soft: #fbf1ef;
  --green: #2f7d3b;          /* underline on paper titles */
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --col: 820px;
  color-scheme: light;       /* always light, like a printed page */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.7 var(--serif); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
h1, h2, h3 { margin: 0; color: var(--ink); }
strong, b { font-weight: 600; color: var(--ink); }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem .75rem; z-index: 20; }
.ico { width: 15px; height: 15px; flex: none; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__inner {
  max-width: var(--col); margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--sans); font-size: .875rem;
}
.top__name { font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.top__nav { display: flex; gap: 20px; }
.top__nav a { color: var(--muted); text-decoration: none; }
.top__nav a:hover { color: var(--ink); }
@media (max-width: 480px) { .top__nav { gap: 14px; } .top__nav a:nth-child(3) { display: none; } }

/* ---------- page ---------- */
.page { max-width: var(--col); margin: 0 auto; padding: 0 16px; }

/* head */
.head {
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center;
  padding: 48px 0 36px; border-bottom: 1px solid var(--ink);
}
@media (min-width: 640px) { .head { grid-template-columns: 176px 1fr; gap: 36px; padding: 72px 0 44px; } }
.head__photo {
  width: 128px; height: 128px; border-radius: 50%; object-fit: cover; display: block;
  filter: grayscale(1) contrast(1.06);
  transition: filter .5s ease;
}
.head__photo:hover { filter: none; }
@media (min-width: 640px) { .head__photo { width: 176px; height: 176px; } }
.head__name { font: 700 clamp(2.25rem, 6vw, 3.25rem)/1.02 var(--serif); letter-spacing: -.025em; }
.head__label {
  display: inline-block; margin-top: 14px; padding: 5px 11px 5px;
  font: 600 .8125rem/1 var(--sans); letter-spacing: .01em;
  color: var(--bg); background: var(--ink); border-radius: 2px;
}
.head__sub { margin-top: 12px; font: 400 .9375rem/1.55 var(--sans); color: var(--muted); }
.head__role { display: block; color: var(--ink); font-weight: 500; margin-bottom: 1px; }
.head__links { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font: 500 .875rem/1 var(--sans); }
.head__links a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; text-decoration: none; color: var(--text); border-bottom: 1px solid transparent; }
.head__links a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* about */
.about { padding-top: 32px; }
.about > p + p, .about .threads + p { margin-top: 1.05em; }
.threads { list-style: none; counter-reset: t; margin: 1.3em 0 0; padding: 0; border-top: 1px solid var(--line); }
.threads li {
  counter-increment: t; position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--line);
}
.threads li::before {
  content: counter(t, decimal-leading-zero); position: absolute; left: 0; top: 15px;
  font: 600 .8125rem/1.7 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums;
}

/* section blocks */
.block { margin-top: 64px; }
.block > h2 {
  display: flex; align-items: baseline; gap: 14px;
  font: 700 1.625rem/1.2 var(--serif); letter-spacing: -.015em; margin-bottom: 18px;
}
.block > h2::after { content: ""; flex: 1; height: 1px; background: var(--ink); transform: translateY(-.3em); }
.note { margin-top: 12px; font: 400 .875rem/1.5 var(--sans); color: var(--muted); }

/* news */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 1fr; gap: 0; padding: 9px 0; }
.news time { font: 500 .8125rem/1.7 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.news li.is-major time { color: var(--ink); font-weight: 600; }
.news li.is-major time::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--ink); vertical-align: .15em; }
@media (min-width: 600px) {
  .news li { grid-template-columns: 124px 1fr; gap: 20px; }
  .news time { padding-top: 3px; }
}
.more { margin-top: 6px; }
.more summary { cursor: pointer; width: max-content; font: 500 .875rem/1 var(--sans); color: var(--muted); padding: 8px 0; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; display: inline-block; width: 1.1em; }
.more[open] summary::before { content: "−"; }
.more summary:hover { color: var(--ink); }

/* tally */
.tally { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--ink); }
@media (min-width: 600px) { .tally { grid-template-columns: repeat(4, 1fr); } }
.tally div { padding: 16px 18px; display: flex; align-items: center; gap: 14px; border-color: var(--line); }
.tally div + div { border-left: 1px solid var(--line); }
@media (max-width: 599px) {
  .tally div:nth-child(3) { border-left: 0; }
  .tally div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.tally dt { font: 700 2.25rem/1 var(--serif); color: var(--ink); }
.tally dd { margin: 0; font: 600 .8125rem/1.3 var(--sans); color: var(--ink); }
.tally dd span { display: block; font-weight: 400; color: var(--muted); }

/* filters */
.filters { margin: 28px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  font: 500 .8125rem/1 var(--sans); padding: 8px 13px; cursor: pointer;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .15s, background-color .15s, color .15s;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* publications */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.pub[hidden] { display: none; }
.pub:last-child { border-bottom: 0; }
@media (min-width: 600px) { .pub { grid-template-columns: 124px 1fr; gap: 20px; } }
.pub__venue { font: 600 .8125rem/1.35 var(--sans); color: var(--ink); padding-top: 3px; }
.pub__venue span { display: block; font-weight: 400; color: var(--muted); }
.pub.is-feature .pub__venue { align-self: start; justify-self: start; padding: 5px 9px; background: var(--ink); color: var(--bg); border-radius: 2px; }
.pub.is-feature .pub__venue span { color: inherit; opacity: .7; }
.pub__title { font: 600 1.125rem/1.4 var(--serif); letter-spacing: -.005em; }
.pub__title a { text-decoration: none; background-image: linear-gradient(var(--ink), var(--ink)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s ease; }
.pub__title a:hover { background-size: 100% 1px; }
.pub__authors { margin-top: 3px; font: 400 .875rem/1.55 var(--sans); color: var(--muted); }
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__sole { color: var(--ink); }
.pub__tldr { margin-top: 6px; font-style: italic; font-size: 1rem; line-height: 1.6; color: var(--text); }
.pub__links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 18px; font: 500 .8125rem/1.6 var(--sans); }
.pub__links a::before, .cite::before { content: "↗ "; color: var(--faint); }
.cite::before { content: "{ } "; }
.pub__links a { text-decoration: none; }
.pub__links a:hover { text-decoration: underline; }
.cite { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.cite:hover { text-decoration: underline; text-underline-offset: .2em; }
.bib {
  margin: 10px 0 0; padding: 14px 16px; background: var(--soft); border-left: 2px solid var(--ink);
  font: .75rem/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; color: var(--text);
}

/* background */
.cols { display: grid; grid-template-columns: 1fr; gap: 36px; }
@media (min-width: 640px) { .cols { grid-template-columns: 1fr 1fr; gap: 44px; } }
.cols h3 { font: 600 .8125rem/1 var(--sans); color: var(--muted); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1rem; line-height: 1.5; }
.facts__when { font: 500 .8125rem/1.7 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.facts .muted { font-size: .9375rem; }

/* footer */
.foot { margin-top: 88px; border-top: 1px solid var(--ink); }
.foot__inner {
  max-width: var(--col); margin: 0 auto; padding: 20px 16px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  font: 400 .8125rem/1.5 var(--sans); color: var(--muted);
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ---------- paper detail page ---------- */
.article { padding-top: 48px; }
.article__back a { font: 500 .875rem/1 var(--sans); text-decoration: none; }
.article__back a::before { content: "← "; }
.article__title { margin-top: 20px; font: 700 clamp(1.9rem, 4.6vw, 2.6rem)/1.12 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.article__venue { margin-top: 16px; display: inline-block; padding: 5px 10px; font: 600 .8125rem/1 var(--sans); color: var(--bg); background: var(--ink); border-radius: 2px; }
.prose { margin-top: 28px; }
.prose p { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.prose h2, .article > h2 { font: 700 1.35rem/1.25 var(--serif); margin: 36px 0 12px; }
.article__cite { color: var(--muted); font-size: .9375rem; }

@media print {
  .top, .filters, .more summary { display: none; }
  .head__photo { filter: grayscale(1); }
}

/* ---------- colour layer (layout above is unchanged) ---------- */
.head__photo { filter: none; }
.head__label { background: var(--maroon); color: #fff; }
.head__links .ico { color: var(--maroon); }
.threads li::before { color: var(--maroon); }
.block > h2::after { background: var(--line); height: 1px; }
.news li.is-major time { color: var(--ink); }
.news li.is-major time::before { background: var(--maroon); }
.tally { border: 2px solid var(--maroon); border-radius: 8px; background: var(--maroon-soft); }
.tally div + div, .tally div:nth-child(n+3) { border-color: color-mix(in srgb, var(--maroon) 25%, transparent); }
.tally dt { color: var(--maroon); }
.filter:hover { border-color: var(--maroon); color: var(--maroon); }
.filter[aria-pressed="true"] { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.pub__venue { color: var(--maroon); }
.pub.is-feature .pub__venue { background: var(--maroon); color: #fff; }
.pub__title a { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 1.5px; text-underline-offset: .22em; background-image: none; }
.pub__title a:hover { color: var(--green); }
.pub__sole { color: var(--maroon); }
.pub__links a, .cite { color: var(--maroon); }
.pub__links a::before, .cite::before { color: var(--maroon); }
.bib { border-left-color: var(--maroon); background: var(--soft); }
.article__venue { background: var(--maroon); color: #fff; }

/* ---------- sticky identity bar ---------- */
.top { transition: box-shadow .25s ease, border-color .25s ease; }
.top.is-stuck { box-shadow: 0 6px 20px -14px rgba(0,0,0,.35); }
.top__inner { gap: 12px; }
.top__id { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
.top__id:hover { color: var(--ink); }
.top__name { font-weight: 600; white-space: nowrap; }
.top__avatar, .top__label, .top__icons {
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease, width .25s ease, margin .25s ease;
}
.top__avatar { width: 0; height: 30px; border-radius: 50%; object-fit: cover; margin-right: -10px; }
.top__label {
  font: 600 .6875rem/1 var(--sans); padding: 4px 7px; border-radius: 2px;
  background: var(--maroon); color: #fff; white-space: nowrap;
}
.top__icons { list-style: none; margin: 0 0 0 auto; padding: 0; display: none; gap: 2px; }
.top__icons a { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); }
.top__icons a:hover { color: var(--maroon); background: var(--maroon-soft); }
.top__icons .ico { width: 15px; height: 15px; }
.top.is-stuck .top__avatar, .top.is-stuck .top__label, .top.is-stuck .top__icons { opacity: 1; pointer-events: auto; transform: none; }
.top.is-stuck .top__avatar { width: 30px; margin-right: 0; }
@media (min-width: 860px) {
  .top__icons { display: flex; }
  .top.is-stuck .top__nav { margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
}
@media (max-width: 600px) { .top__label { display: none; } .top__nav a:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) { .top__avatar, .top__label, .top__icons { transition: none; } }

/* ---------- research thread illustrations ---------- */
.threads--glyph li { padding-left: 92px; min-height: 64px; }
.threads--glyph li::before { content: none; }
.thread__glyph { position: absolute; left: 0; top: 16px; width: 64px; height: 40px; overflow: visible; }
.thread__glyph .g-axis { fill: none; stroke: var(--line); stroke-width: 1.5; }
.thread__glyph .g-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.thread__glyph .g-dot { fill: var(--maroon); }
.thread__glyph .g-fill rect { fill: var(--ink); }
.thread__glyph .g-ghost rect { fill: none; stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 2 2; }
.thread__glyph .g-stop { stroke: var(--maroon); stroke-width: 2; }
.thread__glyph .g-block { fill: var(--maroon-soft); stroke: var(--ink); stroke-width: 1.6; }
.threads--glyph li { padding-left: 96px; min-height: 92px; }
.thread__glyph {
  top: 16px; width: 72px; height: 56px; padding: 10px 8px;
  background: var(--maroon-soft); border-radius: 10px; box-sizing: border-box;
}
@media (max-width: 520px) {
  .threads--glyph li { padding-left: 76px; min-height: 80px; }
  .thread__glyph { top: 16px; width: 60px; height: 48px; padding: 8px 6px; }
}

/* ---------- NeurIPS figure ---------- */
.fig { margin: 16px 0 4px; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fcfcfc; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig__grid line { stroke: var(--line); stroke-width: 1; }
.fig__grid line:first-child, .fig__grid line:nth-child(2) { stroke: #c9c9c9; }
.fig__guide { stroke: var(--maroon) !important; stroke-dasharray: 3 4; opacity: .55; }
.fig__weak, .fig__strong { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.fig__weak { stroke: #9a9a9a; }
.fig__strong { stroke: var(--maroon); }
.fig__dot { fill: #9a9a9a; } .fig__dot--strong { fill: var(--maroon); }
.fig__txt text { font: 400 11.5px var(--sans); fill: var(--muted); }
.fig__k { font-weight: 600 !important; fill: #7a7a7a !important; }
.fig__k--strong { fill: var(--maroon) !important; }
.fig figcaption { margin-top: 8px; font: 400 .8125rem/1.5 var(--sans); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .fig__strong, .fig__weak { stroke-dasharray: 700; stroke-dashoffset: 700; animation: fig-draw 1.4s cubic-bezier(.6,.1,.3,1) .2s forwards; }
  .fig__weak { animation-delay: .5s; }
  @keyframes fig-draw { to { stroke-dashoffset: 0; } }
}

/* ---------- typography polish ---------- */
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.about > p:first-child { font-size: 1.1875rem; line-height: 1.65; color: var(--ink); }
.about, .pub__tldr, .news p { font-variant-numeric: oldstyle-nums proportional-nums; }
.about strong { font-weight: 600; box-shadow: inset 0 -.32em 0 var(--maroon-soft); }
.head__name { font-feature-settings: "kern", "liga", "dlig"; }
.pub__authors, .news time, .facts__when, .tally { font-variant-numeric: lining-nums tabular-nums; }
::selection { background: var(--maroon); color: #fff; }
