/* parekhvarun.com
   Navy and Georgia Tech gold. The heat map keeps the inferno thermal colormap, since it shows data. */

:root {
  --paper: #FAFBFC;
  --surface: #EEF1F5;
  --rule: #D9DEE5;
  --ink: #0E2240;
  --muted: #52606D;
  --accent: #1E3A6B;
  --accent-dark: #122848;
  --heat: #B3A369;
  --dash: #98A2B3;
  --panel: #000004;
  --on-accent: #FFFFFF;
  --shadow: rgba(14, 34, 64, 0.16);

  --wrap: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --measure: 64ch;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-stretch: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
@media (max-width: 860px) {
  html { scroll-padding-top: 140px; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

p { margin: 0 0 1em; }

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -48px;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: var(--radius); z-index: 50;
}
.skip:focus { top: 12px; }

/* Draft note: remove the element once every placeholder is filled */
.draft-note {
  background: var(--surface);
  border-bottom: 1px dashed var(--muted);
  font-size: 0.875rem;
  color: var(--muted);
}
.draft-note .wrap { padding-top: 8px; padding-bottom: 8px; }

/* ---------- Header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 64px;
}
.brand {
  font-stretch: 118%;
  font-weight: 750;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }

.site-nav ul {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
.site-nav a:hover { color: var(--accent); background: var(--surface); }
.site-nav a[aria-current="page"],
.site-nav a.is-current {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}
.site-nav .resume-menu a {
  display: block;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  box-shadow: none;
  border-radius: var(--radius);
}
.site-nav .resume-menu a:hover { background: var(--surface); }

@media (max-width: 860px) {
  .site-head .wrap { flex-wrap: wrap; gap: 0; padding-top: 10px; }
  .site-nav { width: 100%; margin-left: -8px; padding: 2px 0 8px; }
  .site-nav ul { flex-wrap: wrap; gap: 0 2px; }
  .site-nav a { padding: 6px 8px; }
  .site-head .resume-picker { position: static; }
  .site-head .resume-menu { left: 12px; right: 12px; width: auto; top: calc(100% - 2px); }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  font: inherit; font-size: 1rem; font-weight: 600;
  color: var(--ink); background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px);
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-id {
  display: flex; align-items: flex-end; gap: 20px;
  margin-bottom: 20px;
}
.portrait {
  flex: none;
  width: 104px; aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  object-fit: cover;
}
.hero h1 {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.75rem, 6.2vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
}
.tagline {
  font-stretch: 100%;
  font-weight: 450;
  font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 28px;
}
.tagline .phrase { white-space: nowrap; }
.intro { max-width: var(--measure); }
.availability {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 24px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.elsewhere {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  list-style: none; margin: 0; padding: 0;
  font-size: 1rem;
}
.email-line { font-size: 1rem; color: var(--muted); margin: 0 0 12px; }

@media (max-width: 520px) {
  .hero-id { gap: 14px; }
  .portrait { width: 76px; }
}

/* ---------- Thermal figure ---------- */

.thermal { margin: 0; }
.thermal-stage {
  position: relative;
  background: var(--panel);
  border-radius: 6px;
  overflow: hidden;
  touch-action: none;
}
.thermal-stage canvas {
  width: 100%; height: auto;
  aspect-ratio: 480 / 340;
  cursor: grab;
}
.thermal-stage canvas.dragging { cursor: grabbing; }
.thermal-stage canvas:focus-visible { outline: 3px solid var(--heat); outline-offset: -3px; }

.thermal-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.colorbar {
  height: 8px; border-radius: 2px;
  background: linear-gradient(90deg, #000004 0%, #1b0c41 11%, #4a0c6b 22%, #781c6d 33%, #a52c60 44%, #cf4446 55%, #ed6925 66%, #fb9b06 77%, #f7d13d 88%, #fcffa4 100%);
}
.thermal-readout {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.9375rem;
}
.thermal-readout output {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-stretch: 110%;
}
.peak-mark {
  display: inline-block; width: 10px; height: 10px;
  border: 2px solid var(--heat); border-radius: 50%;
  margin-right: 6px; vertical-align: -1px;
}
.link-button {
  font: inherit; font-size: 0.9375rem;
  background: none; border: 0; padding: 4px 0;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.thermal figcaption {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Sections and page titles ---------- */

.page-head { padding: clamp(40px, 6vw, 72px) 0 8px; }
.page-head h1 {
  font-stretch: 118%;
  font-weight: 750;
  font-size: clamp(2.25rem, 4.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.lead { max-width: var(--measure); font-size: 1.1875rem; }
@media (max-width: 640px) { .lead { font-size: 1.0625rem; } }

.section { padding: 32px 0 56px; }
.section + .section { border-top: 1px solid var(--rule); }

.section-title {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}
.single .section-title {
  font-stretch: 118%;
  font-weight: 750;
  font-size: clamp(2rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.sub-title {
  font-stretch: 110%;
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.25;
  margin: 40px 0 12px;
}
.sub-title:first-child { margin-top: 0; }

/* Rows with a date column: news, experience, outreach */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 4px 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.rows > li:last-child { border-bottom: 1px solid var(--rule); }
.rows time, .rows .when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  padding-top: 2px;
}
.rows .what { max-width: var(--measure); }
.rows .what strong { font-weight: 650; }
.rows .detail { color: var(--muted); font-size: 1rem; display: block; margin-top: 2px; }
@media (max-width: 640px) {
  .rows > li { grid-template-columns: 1fr; }
}

.news-more summary {
  cursor: pointer; color: var(--accent);
  margin-top: 14px; font-size: 1rem;
  width: max-content;
}
.news-more[open] summary { margin-bottom: 0; }

/* ---------- Research chain ---------- */

.narrative { max-width: var(--measure); }

.chain { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: step; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 0 28px;
  padding-bottom: 44px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  grid-column: 1; grid-row: 1 / span 2;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent);
  font-weight: 700; font-stretch: 110%;
  font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
.step::after {
  content: "";
  position: absolute; left: calc(1.25rem - 1px); top: 2.5rem; bottom: 0;
  border-left: 2px solid var(--rule);
}
.step:last-child::after { display: none; }
.step-body { grid-column: 2; min-width: 0; }
.step-figure { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
.step-kicker {
  color: var(--muted);
  font-size: 1rem;
  margin: 6px 0 2px;
}
.item-title {
  font-stretch: 110%;
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
.result {
  margin: 12px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  font-weight: 500;
}
.venue { color: var(--muted); font-size: 1rem; margin-top: 8px; }
.award {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.award::before {
  content: ""; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--heat); margin-right: 8px; vertical-align: 0;
}

@media (max-width: 860px) {
  .step { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 18px; }
  .step-figure { grid-column: 2; grid-row: auto; margin-top: 16px; }
}

.threads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px 48px;
  margin-top: 8px;
}
.thread { border-top: 2px solid var(--ink); padding-top: 14px; }
.status { color: var(--muted); font-size: 1rem; }

/* ---------- Placeholders (draft only) ---------- */

.placeholder {
  display: grid; place-items: center;
  border: 1.5px dashed var(--dash);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  padding: 12px;
}
.placeholder.fig { aspect-ratio: 4 / 3; }
.placeholder.text { place-items: start; text-align: left; padding: 16px 18px; font-size: 1rem; }

/* ---------- Publications ---------- */

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  padding-top: 2px;
}
.pub-title { font-weight: 600; margin: 0 0 4px; max-width: 72ch; line-height: 1.4; }
.pub-meta { color: var(--muted); font-size: 1rem; margin: 0; max-width: 72ch; }
.pub-meta b { color: var(--ink); font-weight: 600; }
.pub-meta cite { font-style: italic; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 32px;
  padding: 3px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600;
  color: var(--accent);
  background: var(--paper);
  text-decoration: none;
}
a.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.missing {
  border: 1.5px dashed var(--dash);
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
}
@media (max-width: 640px) {
  .pub { grid-template-columns: 1fr; }
}

.scholar-line { margin-top: 24px; }

/* ---------- Experience ---------- */

.skills { margin: 0; display: grid; gap: 12px; max-width: 72ch; }
.skills div { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 4px 24px; }
.skills dt { font-weight: 650; }
.skills dd { margin: 0; }
@media (max-width: 640px) { .skills div { grid-template-columns: 1fr; } }

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 24px;
  list-style: none; margin: 0; padding: 0;
}
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 8px; font-size: 0.9375rem; line-height: 1.45; }
.gallery figcaption span { display: block; color: var(--muted); }

/* ---------- Footer ---------- */

.site-foot {
  margin-top: 48px;
  border-top: 1px solid var(--rule);
  padding: 40px 0 56px;
  font-size: 1rem;
}
.site-foot .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: end;
}
.foot-cta h2 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.foot-cta p { color: var(--muted); max-width: 52ch; margin-bottom: 16px; }
.foot-meta { color: var(--muted); font-size: 0.875rem; text-align: right; }
.foot-meta ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 16px; justify-content: flex-end; flex-wrap: wrap; font-size: 1rem; }
@media (max-width: 760px) {
  .site-foot .wrap { grid-template-columns: 1fr; }
  .foot-meta, .foot-meta ul { text-align: left; justify-content: flex-start; }
}

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

@media print {
  .site-head, .draft-note, .thermal, .site-nav { display: none; }
  body { background: #fff; }
}

.before-phd { margin-top: 32px; }

/* Real media once added */
.gallery img, .step-figure img, .step-figure video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- About (home hero): the person first ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
  padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 6vw, 72px);
}
.about-photo { position: relative; max-width: 420px; }
.about-photo::before {
  content: "";
  position: absolute;
  inset: 20px -20px -20px 20px;
  background: var(--heat);
  border-radius: 8px;
}
.photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
}
.photo.placeholder { padding: 28px; font-size: 1rem; }
.greeting {
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}
.role-line {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.4;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 24px;
}
.bio p { max-width: var(--measure); }
.bio { margin-bottom: 8px; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; margin-bottom: 8px; }
}

/* ---------- My path so far: a route of stops ---------- */

.journey {
  position: relative;
  list-style: none; margin: 12px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 24px;
}
.journey::before {
  content: "";
  position: absolute; left: 8px; right: 8px; top: 8px;
  border-top: 2px solid var(--rule);
}
.stop { position: relative; padding-top: 34px; }
.pin {
  position: absolute; top: 0; left: 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--accent);
}
.stop.next .pin { background: var(--heat); border-color: var(--heat); }
.stop-place {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.25;
}
.stop-when {
  color: var(--muted);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 8px;
}
.stop-text { font-size: 1rem; line-height: 1.5; margin: 0; }
@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr; gap: 0; }
  .journey::before { left: 8px; right: auto; top: 8px; bottom: 8px; border-top: 0; border-left: 2px solid var(--rule); }
  .stop { padding: 0 0 26px 40px; }
  .pin { top: 2px; }
}

/* ---------- What I work on, Outside the lab ---------- */

.work {
  list-style: none; margin: 0 0 20px; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
}
.work li { border-top: 2px solid var(--ink); padding-top: 14px; }
.work li p { margin: 0; }
.work img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; }
.work-title {
  font-stretch: 110%;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* ---------- Research intro with the heat map ---------- */

.research-intro {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  margin-bottom: 16px;
}
@media (max-width: 920px) {
  .research-intro { grid-template-columns: 1fr; }
}

.areas { margin-top: 4px; }
.areas .venue { margin-top: 10px; }

/* ---------- Path map: the world as a ball grid array ---------- */

:root { --map-dot: #CDD5E0; color-scheme: light; }

.pathmap { position: relative; margin: 4px 0 40px; }
.pathmap svg { width: 100%; height: auto; overflow: visible; }
.pathmap .land { fill: var(--map-dot); }
.route-seg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}
.traveler { fill: var(--heat); opacity: 0; }
.pin-dot {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 3.5;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 0.35s cubic-bezier(0.2, 1.6, 0.4, 1), stroke 0.2s;
}
.map-pin.is-on .pin-dot { transform: scale(1); }
.map-pin.here .pin-dot { fill: var(--heat); }
.map-pin.is-hot .pin-dot { stroke: var(--heat); transform: scale(1.45); }
.pin-ring {
  fill: none;
  stroke: var(--heat);
  stroke-width: 2.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.pathmap.is-done .map-pin.here .pin-ring { animation: ping 2.4s ease-out 0.2s 3; }
@keyframes ping {
  0% { opacity: 0.9; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.9); }
}

.map-labels { position: absolute; inset: 0; pointer-events: none; }
.map-label {
  position: absolute;
  display: none;
  font-size: 0.875rem;
  font-weight: 650;
  font-stretch: 106%;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s, color 0.2s;
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 6px var(--paper);
}
.pathmap.is-ready .map-label { display: block; }
.map-label.is-on { opacity: 1; }
.map-label.is-hot { color: var(--accent); }
.map-label.side-left { transform: translate(calc(-100% - 14px), -50%); }
.map-label.side-right { transform: translate(14px, -50%); }
.map-label.side-below { transform: translate(-50%, 12px); }
@media (max-width: 640px) {
  .map-label { font-size: 0.75rem; }
  .map-label.side-left { transform: translate(calc(-100% - 8px), -50%); }
  .map-label.side-right { transform: translate(8px, -50%); }
  .map-label.side-below { transform: translate(-50%, 7px); }
  .pathmap { margin-bottom: 28px; }
}
.stop[data-stop] { cursor: default; }

/* ---------- Placement challenge ---------- */

.challenge {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  margin: 20px 0 8px;
}
@media (max-width: 920px) { .challenge { grid-template-columns: 1fr; } }

.scoreboard {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 0 0 12px;
}
.scoreboard div { border-top: 2px solid var(--ink); padding-top: 8px; }
.scoreboard dt { font-size: 0.875rem; color: var(--muted); }
.scoreboard dd { margin: 2px 0 0; }
.scoreboard output {
  font-stretch: 112%;
  font-weight: 750;
  font-size: 1.625rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tradeoff { width: 100%; height: auto; display: block; overflow: visible; }
.tradeoff .grid { stroke: var(--rule); stroke-width: 1; }
.tradeoff .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tradeoff .axis-title { fill: var(--muted); font-size: 11.5px; }
.tradeoff .better { fill: var(--muted); font-size: 11.5px; font-style: italic; }
.tradeoff .front-line { fill: none; stroke: var(--heat); stroke-width: 2.25; stroke-linejoin: round; }
.tradeoff .front-dot { fill: var(--heat); cursor: pointer; }
.tradeoff .front-dot:hover { stroke: var(--ink); stroke-width: 1.5; }
.tradeoff .front-dot.knee { stroke: var(--ink); stroke-width: 1.5; }
.tradeoff .front-label { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
.tradeoff .start-dot { fill: var(--muted); }
.tradeoff .start-label { fill: var(--muted); font-size: 11px; }
.tradeoff .you-dot { fill: none; stroke: var(--accent); stroke-width: 3; }
.tradeoff .you-label { fill: var(--accent); font-size: 12px; font-weight: 700; }

.verdict { min-height: 3em; margin: 10px 0 12px; font-size: 1rem; line-height: 1.5; }
.verdict.win { color: var(--accent); font-weight: 600; }
.challenge-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Resume picker ---------- */

.resume-picker { position: relative; display: inline-block; }
.resume-picker summary { list-style: none; cursor: pointer; }
.resume-picker summary::-webkit-details-marker { display: none; }
.resume-picker summary::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
.resume-picker[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.resume-menu {
  position: absolute; z-index: 30;
  top: calc(100% + 8px); left: 0;
  width: min(340px, 86vw);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 12px 32px var(--shadow);
  padding: 8px;
}
.resume-picker.align-right .resume-menu { left: auto; right: 0; }
.resume-menu-title { font-size: 0.8125rem; color: var(--muted); margin: 4px 10px 6px; }
.resume-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}
.resume-menu a:hover, .resume-menu a:focus-visible { background: var(--surface); }
.resume-menu strong { display: block; font-weight: 650; font-size: 1rem; color: var(--accent); }
.resume-menu span { display: block; font-size: 0.875rem; color: var(--muted); line-height: 1.4; }
.nav-resume-btn {
  display: inline-flex; align-items: center;
  padding: 6px 10px;
  font-size: 0.9375rem; font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  margin-left: 8px;
}
.nav-resume-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-resume-btn::after { margin-left: 8px !important; width: 6px !important; height: 6px !important; }
@media (max-width: 860px) { .nav-resume-btn { margin-left: 0; padding: 5px 10px; } }

.resume-cards {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.resume-cards a {
  display: block; height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.resume-cards a:hover { border-color: var(--accent); }
.resume-cards strong { display: block; font-stretch: 110%; font-weight: 700; font-size: 1.125rem; color: var(--accent); }
.resume-cards span { display: block; color: var(--muted); font-size: 0.9375rem; margin-top: 4px; }
.resume-cards em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 0.8125rem; font-weight: 650; color: var(--ink); }

/* ---------- Publication filters and citations ---------- */

.pub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 28px; }
.filter {
  font: inherit; font-size: 0.9375rem;
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.filter span { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.filter:hover { border-color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filter[aria-pressed="true"] span { color: inherit; opacity: 0.8; }
.pub-group[hidden], .pub[hidden] { display: none; }

button.chip { font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.chip.cite-toggle[aria-expanded="true"] { border-color: var(--accent); }
.cite-panel { margin-top: 10px; }
.cite-panel pre {
  margin: 0 0 6px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 72ch;
}
.cite-status { margin-left: 10px; font-size: 0.875rem; color: var(--muted); }

/* ---------- Dark mode ---------- */

:root[data-theme="dark"] {
  --paper: #0B1628; --surface: #14243D; --rule: #263A57; --ink: #E7EDF6; --muted: #9EADC2;
  --accent: #93B5EE; --accent-dark: #B9CFF5; --on-accent: #0B1628; --heat: #D6C68C; --dash: #52647F;
  --map-dot: #243756; --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1628; --surface: #14243D; --rule: #263A57; --ink: #E7EDF6; --muted: #9EADC2;
    --accent: #93B5EE; --accent-dark: #B9CFF5; --on-accent: #0B1628; --heat: #D6C68C; --dash: #52647F;
    --map-dot: #243756; --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

.nav-theme { margin-left: 4px; }
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Now ---------- */

.now {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 16px 48px;
}
.now .section-title { margin-bottom: 6px; }
.now-note { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.now-list { list-style: none; margin: 0; padding: 0; }
.now-list li {
  position: relative;
  padding: 10px 0 10px 26px;
  border-top: 1px solid var(--rule);
}
.now-list li:last-child { border-bottom: 1px solid var(--rule); }
.now-list li::before {
  content: "";
  position: absolute; left: 2px; top: 19px;
  width: 9px; height: 9px;
  background: var(--heat);
  border-radius: 1px;
}
@media (max-width: 760px) { .now { grid-template-columns: 1fr; } }

/* ---------- Reflow ---------- */

.reflow-invite { margin-top: 10px; font-size: 0.9375rem; }
.reflow-invite .link-button { font-size: 0.9375rem; font-weight: 600; }
.reflow-invite .link-button:disabled { opacity: 0.5; cursor: default; }
.reflow-heat {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 35;
  opacity: 0;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .reflow-heat { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .reflow-heat { mix-blend-mode: normal; } }
html.is-reflowing main .wrap > *, html.is-reflowing .site-foot .wrap { will-change: transform; transform-origin: 50% 50%; }

.reflow-hud {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 340px;
  padding: 16px 18px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 16px 40px var(--shadow);
}
@media (max-width: 520px) { .reflow-hud { left: 12px; right: 12px; bottom: 12px; width: auto; } }
.reflow-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.reflow-temp {
  display: block;
  font-stretch: 115%;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reflow-phase { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.reflow-profile, .reflow-xs { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
.reflow-profile .grid { stroke: var(--rule); }
.reflow-profile .tick { fill: var(--muted); font-size: 9px; }
.reflow-profile .liquidus { stroke: var(--muted); stroke-dasharray: 3 3; }
.reflow-profile .profile-line { fill: none; stroke: var(--rule); stroke-width: 2.5; stroke-linejoin: round; }
.reflow-profile .profile-done { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.reflow-profile .profile-dot { fill: var(--heat); stroke: var(--paper); stroke-width: 1.5; }
.reflow-xs .xs-sub { fill: var(--accent); opacity: 0.35; }
.reflow-xs .xs-int { fill: var(--accent); opacity: 0.6; }
.reflow-xs .xs-die { fill: var(--ink); opacity: 0.85; }
.reflow-xs .xs-hbm { fill: var(--accent); opacity: 0.9; }
.reflow-xs .xs-ball { fill: var(--heat); }
.reflow-warp { margin: 6px 0 4px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.reflow-warp span { color: var(--muted); }
.reflow-note { margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.reflow-done { margin: 8px 0 0; font-size: 0.875rem; font-weight: 600; color: var(--accent); }
.reflow-done:empty { display: none; }

/* Research steps without a figure use the full text width */
.step.no-fig .step-body { grid-column: 2 / -1; max-width: var(--measure); }
