/* Vaibhav Bajpai — shared styles. After the ProofBench site: Computer Modern, black and white, hairline borders, one dark-red accent. */

@font-face { font-family: "CMU Serif"; src: url("../fonts/cmunrm.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("../fonts/cmunbx.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("../fonts/cmunti.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "CMU Typewriter"; src: url("../fonts/cmuntt.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #000;
  --muted: #666;
  --line: #ccc;
  --line-soft: #e6e6e6;
  --soft: #fafafa;
  --bg: #fff;
  --accent: #9b1c1c;
  --code-bg: #1a1a1a;
  --code-ink: #e0e0e0;
  --code-dim: #8a8a8a;
  --serif: "CMU Serif", "Computer Modern", "Latin Modern Roman", "Times New Roman", Times, serif;
  --tt: "CMU Typewriter", "Courier New", Courier, monospace;
  --mono: "JetBrains Mono", "DejaVu Sans Mono", Consolas, monospace;
  --gutter: clamp(20px, 5vw, 80px);
}

/* ---------- base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--serif); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p a, li a, dd a, .link { color: var(--accent); }
b, strong { font-weight: 700; }
code { font-family: var(--tt); font-size: 0.92em; background: #f0f0f0; padding: 1px 4px; }
pre code { background: none; padding: 0; font-family: var(--mono); font-variant-ligatures: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 6px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ink);
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand .qed { width: 12px; height: 12px; background: var(--ink); display: inline-block; transition: background .2s, transform .3s; }
.brand:hover .qed { background: var(--accent); transform: rotate(90deg); }
.header-nav { list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 26px; font-size: 15px; }
.header-nav a { color: #333; padding: 2px 0; border-bottom: 1px solid transparent; }
.header-nav a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--ink); }
.header-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.header-nav a.btn { color: #fff; padding: 6px 14px; font-size: 12px; border-bottom: 1px solid var(--ink); }
.header-nav a.btn:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--tt); font-size: 13px; line-height: 1.3;
  padding: 11px 24px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.btn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.btn-secondary { background: var(--bg); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-small { font-size: 12px; padding: 5px 12px; }

/* ---------- page shell ---------- */
.main { max-width: 960px; margin: 0 auto; padding: 56px var(--gutter) 96px; }
.page-intro { margin-bottom: 40px; }
.page-intro h1 { font-size: 34px; font-weight: 400; font-style: italic; line-height: 1.25; margin-bottom: 14px; }
.page-intro p { font-size: 17px; color: #333; max-width: 680px; }
.subnav { list-style: none; display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14px; margin: 18px 0 0; }
.subnav a { color: #333; border-bottom: 1px solid var(--line); }
.subnav a:hover { text-decoration: none; border-color: var(--ink); }

h2.rule { font-size: 21px; font-weight: 700; margin: 56px 0 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.label { font-family: var(--tt); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.more-link { display: inline-block; font-family: var(--tt); font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--ink); }
.more-link:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }

/* code blocks */
.code-block { position: relative; background: var(--code-bg); color: var(--code-ink); padding: 18px 22px; overflow-x: auto; margin-top: 16px; }
.code-block pre { font-size: 12.5px; line-height: 1.7; white-space: pre; }
.code-caption { font-family: var(--tt); font-size: 12px; color: var(--muted); margin-top: 8px; }
.tok-kw { color: #ef9a76; }
.tok-ty { color: #e6d3a3; }
.tok-num { color: #b9d69a; }
.tok-sym { color: #d9b8f0; }
.tok-com { color: var(--code-dim); font-style: italic; }
.tok-sorry { color: #f2c14e; text-decoration: underline wavy rgba(242, 193, 78, .55); text-underline-offset: 4px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--ink); padding: 26px var(--gutter);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px;
  font-size: 13px; color: #555;
}
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a { color: #333; }

/* ======================================================================
   HOME
   ====================================================================== */
.intro { max-width: calc(1080px + 2 * var(--gutter)); margin: 0 auto; padding: 84px var(--gutter) 0; display: grid; grid-template-columns: 1.3fr .7fr; gap: 64px; align-items: center; }
.intro > *, .team-grid > * { min-width: 0; }
.eyebrow { font-family: var(--tt); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.intro h1 { font-size: clamp(50px, 7.6vw, 96px); font-weight: 400; line-height: .98; letter-spacing: -.01em; margin-bottom: 18px; }
.tagline { font-size: clamp(22px, 2.6vw, 31px); font-style: italic; line-height: 1.3; margin-bottom: 22px; text-wrap: balance; }
.tagline em { color: var(--accent); }
.lede { font-size: 18px; line-height: 1.65; color: #333; max-width: 34em; margin-bottom: 30px; }
.lede + .lede { margin-top: -16px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.inst { font-family: var(--tt); font-size: 12px; color: var(--muted); letter-spacing: .03em; }

.portrait { border: 1px solid var(--ink); background: var(--bg); box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .55); }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 20%; }
.portrait figcaption { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--ink); font-family: var(--tt); font-size: 12px; color: #555; }

.stats { max-width: calc(1080px + 2 * var(--gutter)); margin: 72px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(4, 1fr); }
.stats > div { padding: 24px 20px 30px; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stats > div:first-child { border-left: 0; padding-left: 0; }
.stats dd { font-size: 46px; line-height: 1; }
.stats dt { font-family: var(--tt); font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }

.section { padding: 96px var(--gutter); }
.section.soft { background: var(--soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.wrap { max-width: 1080px; margin: 0 auto; }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 400; line-height: 1.18; margin-bottom: 16px; text-wrap: balance; }
.section-head p { font-size: 18px; color: #333; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); background: var(--bg); }
.pillar { padding: 28px 26px 30px; border-left: 1px solid var(--line); transition: background .2s; }
.pillar:first-child { border-left: 0; }
.pillar:hover { background: var(--soft); }
.pillar svg { width: 100%; height: 84px; margin-bottom: 18px; color: var(--ink); }
.pillar h3 { font-size: 18px; margin: 0 0 8px; }
.pillar p { font-size: 15px; color: #333; line-height: 1.6; }

.explore { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.explore-card { display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); padding: 26px 28px 28px; transition: transform .2s ease, box-shadow .2s ease; }
.explore-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .45); }
.explore-card.wide { grid-column: 1 / -1; }
.explore-card .label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.explore-card .label span { color: var(--muted); }
.explore-card h3 { font-size: 24px; font-weight: 400; margin: 0 0 10px; }
.explore-card p:not(.label) { font-size: 15px; color: #333; margin-bottom: 16px; flex: 1; }
.explore-card .go { align-self: flex-start; font-family: var(--tt); font-size: 13px; border-bottom: 1px solid var(--ink); }
.explore-card:hover .go { color: var(--accent); border-color: var(--accent); }

.cta-box { border: 1px solid var(--ink); padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--bg); }
.cta-box h3 { margin: 0 0 4px; font-size: 21px; font-weight: 400; font-style: italic; }
.cta-box p { color: #333; font-size: 15px; }
.cta-box .ctas { margin: 0; }
.explore + .cta-box { margin-top: 56px; }

/* ======================================================================
   PUBLICATIONS
   ====================================================================== */
.pubs { list-style: none; }
.pub { display: grid; grid-template-columns: 3em 1fr; gap: 0 14px; padding: 22px 16px 24px 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; transition: background .3s, border-color .3s; }
.pub:first-child { padding-top: 8px; }
.pub:target { background: var(--soft); border-left-color: var(--accent); }
.pub > * { min-width: 0; }
.pub-num { font-family: var(--tt); font-size: 13px; color: var(--accent); padding: 4px 0 0 10px; }
.pub-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.pub-authors { font-size: 16px; color: #222; }
.pub-venue { font-size: 15.5px; color: #444; margin-top: 2px; }
.pub-note { font-size: 15px; color: #444; margin-top: 8px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ======================================================================
   RESEARCH COLLABORATION
   ====================================================================== */
.project { display: grid; grid-template-columns: 250px 1fr; border: 1px solid var(--ink); background: var(--bg); margin-bottom: 24px; }
.project > * { min-width: 0; }
.project-visual { border-right: 1px solid var(--ink); background: var(--soft); display: grid; place-items: center; padding: 26px 22px; }
.project-visual svg { width: 100%; max-width: 210px; height: auto; color: var(--ink); }
.project-body { padding: 26px 30px 30px; }
.project-body .label { margin-bottom: 8px; }
.project-body h2 { font-size: 28px; font-weight: 400; line-height: 1.2; margin-bottom: 4px; }
.project-sub { font-style: italic; color: #444; margin-bottom: 12px; }
.project-body > p:not(.label):not(.project-sub) { font-size: 16px; color: #222; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chips li { font-family: var(--tt); font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); background: var(--bg); }
.project-actions { margin-top: 20px; }

/* ======================================================================
   BENCHMARK EVALUATION
   ====================================================================== */
.page-ctas { margin: 22px 0 0; }
.workflows { display: grid; grid-template-columns: 1fr; gap: 24px; }
.workflow { display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--bg); padding: 26px 28px 28px; }
.workflow > * { min-width: 0; }
.wf-glyph { font-size: 44px; line-height: 1; color: var(--accent); margin-bottom: 14px; }
.workflow .label { margin-bottom: 6px; }
.workflow h3 { font-size: 24px; font-weight: 400; margin: 0 0 10px; }
.workflow > p:not(.label):not(.wf-glyph) { font-size: 15.5px; color: #333; }
.wf-list { list-style: none; margin: 18px 0 24px; border-top: 1px solid var(--line); columns: 2; column-gap: 36px; }
.wf-list li { font-size: 14.5px; line-height: 1.5; padding: 7px 0 7px 18px; border-bottom: 1px solid var(--line-soft); position: relative; break-inside: avoid; }
.wf-list li::before { content: ""; position: absolute; left: 0; top: 14px; width: 6px; height: 6px; background: var(--ink); }
.workflow .btn { align-self: flex-start; }
.prose ul { margin: 0 0 8px 22px; max-width: 760px; }
.prose li { margin-bottom: 10px; color: #222; }
.cta-box.spaced { margin-top: 56px; }

/* ======================================================================
   AUTHOR & EDITOR
   ====================================================================== */
.book { display: grid; grid-template-columns: 1fr 210px; gap: 28px; align-items: start; border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 22px 24px; margin-bottom: 16px; background: var(--bg); transition: border-color .2s; }
.book:hover { border-color: var(--ink); }
.book.plain { grid-template-columns: 1fr; }
.book > * { min-width: 0; }
.book-type { font-family: var(--tt); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.book h3 { font-size: 19px; line-height: 1.35; margin: 0 0 6px; }
.book > div > p:not(.book-type) { font-size: 15.5px; color: #333; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; font-size: 14.5px; margin-top: 14px; }
.meta dt { font-family: var(--tt); font-size: 12px; color: var(--muted); padding-top: 2px; }
.meta dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.thumb { display: block; border: 1px solid var(--line); background: var(--bg); color: var(--ink); transition: border-color .2s, transform .2s; }
.thumb:hover { text-decoration: none; border-color: var(--ink); transform: translateY(-2px); }
.thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.thumb span { display: block; font-family: var(--tt); font-size: 12px; padding: 6px 10px; border-top: 1px solid var(--line); }
.book.has-cover { grid-template-columns: 1fr 160px; }
.book h3 a:hover { color: var(--accent); }
.thumb.cover img { aspect-ratio: auto; }

/* ======================================================================
   AWARDS
   ====================================================================== */
.records { list-style: none; }
.records li { display: grid; grid-template-columns: 11em 1fr; gap: 4px 24px; padding: 18px 0 20px; border-bottom: 1px solid var(--line); }
.records li > * { min-width: 0; }
.rec-type { font-family: var(--tt); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-top: 4px; }
.records h3 { font-size: 18px; margin: 0 0 4px; }
.records p { font-size: 15.5px; color: #333; }
.records .more-link { margin-top: 10px; font-size: 12px; }

.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cert { display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); transition: transform .2s ease, box-shadow .2s ease; }
.cert:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .45); }
.cert img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 1px solid var(--ink); }
.cert.portrait img { object-position: center top; }
.cert div { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.cert .label { margin-bottom: 6px; }
.cert h3 { font-size: 17px; line-height: 1.35; margin: 0 0 4px; }
.cert p:not(.label) { font-size: 14px; color: #555; flex: 1; }
.cert .go { align-self: flex-start; margin-top: 12px; font-family: var(--tt); font-size: 12px; border-bottom: 1px solid var(--ink); }
.cert:hover .go { color: var(--accent); border-color: var(--accent); }

/* ======================================================================
   RESUME
   ====================================================================== */
.resume-embed { margin: 0; }
.resume-frame { display: block; width: 100%; aspect-ratio: 1 / 1.25; min-height: 540px; max-height: 1100px; border: 1px solid var(--ink); background: var(--soft); }
.resume-embed figcaption { font-family: var(--tt); font-size: 12px; color: var(--muted); margin-top: 10px; }
.resume-embed figcaption a { color: var(--accent); }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- motion & responsive ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; gap: 44px; }
  .portrait { max-width: 380px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-left: 0; border-top: 1px solid var(--line); }
  .pillar:first-child { border-top: 0; }
}

@media (max-width: 720px) {
  .project { grid-template-columns: 1fr; }
  .project-visual { border-right: 0; border-bottom: 1px solid var(--ink); padding: 22px; }
  .project-visual svg { max-width: 220px; }
  .book { grid-template-columns: 1fr; gap: 18px; }
  .thumb { max-width: 280px; }
  .book.has-cover { grid-template-columns: 1fr; }
  .thumb.cover { max-width: 170px; }
  .explore, .cert-grid, .workflows { grid-template-columns: 1fr; }
  .records li { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header { position: relative; flex-direction: column; align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
  html { scroll-padding-top: 12px; }
  .header-nav { gap: 6px 16px; font-size: 14px; }
  .main { padding-top: 36px; }
  .intro { padding-top: 48px; }
  .stats { margin-top: 48px; }
  .stats > div { border-left: 0 !important; padding-left: 0 !important; }
  .stats dd { font-size: 36px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .pub { grid-template-columns: 1fr; padding-left: 10px; }
  .wf-list { columns: 1; }
  .pub-num { padding: 0 0 4px; }
  .project-body { padding: 22px 20px 24px; }
  .book { padding: 18px 16px; }
  .cta-box { padding: 22px 20px; }
  .resume-frame { min-height: 460px; }
}
