/* ---------- tokens ---------- */
:root {
  --paper: #fdfbf7;           /* page background — very light warm cream */
  --ink: #302820;             /* dark brown */
  --muted: #6b5f53;           /* 5.6:1 on paper */
  --rule: #e4dccf;
  --panel: #f1ebe1;
  --accent: #704264;          /* plum — links and highlights, 7.8:1 on paper */
  --accent-ink: #5a3450;      /* deeper plum for text on tinted fills */
  --accent-soft: #f3e8ee;
  --on-accent: #ffffff;
  --sage: #527568;            /* occasional accent */
  --sage-ink: #3d5a4f;
  --sage-soft: #e3ebe5;
  --rose: #b66e87;            /* occasional accent — decorative only */
  --rose-ink: #8a4560;
  --rose-soft: #f3e3e8;
  --ph-1: #f1e6d8;  --ph-2: #efe3e6;  --ph-3: #e6ece6;  --ph-4: #f2eadb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --name: "Fredoka", "DM Sans", system-ui, sans-serif;   /* just for "Srija Anand" */

  --page: 72rem;
  --measure: 48rem;           /* ~800px max line length for prose */
}
:root { color-scheme: light; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.125rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--rose-soft); color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .15s, text-decoration-thickness .15s, color .15s;
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 2rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
h2 { font: 500 1.875rem/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 1.25rem; }
h2 .emoji { font-size: .8em; margin-left: .15em; vertical-align: .05em; }
.emoji { display: inline-block; font-style: normal; transition: transform .2s ease; }
.emoji:hover { transform: rotate(-14deg) scale(1.1); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 3.75rem; }
.wordmark { font: 500 1.25rem var(--name); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--accent); }
.topbar nav { display: flex; gap: 1.75rem; font: 500 .9375rem var(--sans); }
.topbar nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.topbar nav a:hover { color: var(--ink); border-bottom-color: var(--rose); }

/* ---------- masthead ---------- */
.masthead {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 4rem; padding-top: 4rem; align-items: start;
}
.portrait { margin: 0; position: sticky; top: 5.5rem; order: 2; }
.portrait img { border-radius: 14px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.intro { max-width: var(--measure); }
h1 {
  font: 500 clamp(2.25rem, 1.75rem + 1.8vw, 3.25rem)/1.1 var(--name);
  letter-spacing: -.015em; margin: 0 0 .6rem;
}
.role { font: 400 1rem/1.5 var(--sans); color: var(--muted); margin: 0 0 1.75rem; }
.role a { color: inherit; }
.role a:hover { color: var(--accent); }
.callout {
  display: inline-flex; align-items: baseline; gap: .55rem; margin: 0 0 1.75rem;
  padding: .5rem 1rem .5rem .8rem; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font: 400 1rem/1.45 var(--sans); color: var(--ink);
}
.callout strong { font-weight: 600; color: var(--accent-ink); }
.statement { font: 400 1.375rem/1.5 var(--serif); margin: 0 0 1.75rem; padding-left: 1rem; border-left: 3px solid var(--sage); }
.bio { font: 400 1.125rem/1.7 var(--sans); }
.bio p { margin: 0 0 1.1em; }
.bio .research { font-style: italic; }
.links { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.links a {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  color: var(--muted); border: 1px solid var(--rule); transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.links a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.links svg { width: 1.1rem; height: 1.1rem; }

/* ---------- news + awards ---------- */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 4rem; padding-top: 3.5rem; margin-top: 4rem; border-top: 1px solid var(--rule); }
.news-list, .award-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--rule); font-size: 1.0625rem; line-height: 1.6; max-width: var(--measure); }
.scroll-box {
  max-height: 27rem; overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--rule); padding: 0 .75rem 0 0;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent);
          mask-image: linear-gradient(to bottom, #000 85%, transparent);
}
.scroll-box.at-end { -webkit-mask-image: none; mask-image: none; }
.scroll-box:focus-visible { outline-offset: 4px; }
.news-list li:first-child, .award-list li:first-child { border-top: 0; }
.news-list time, .award-year { font: 500 .8125rem/1.9 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.news-list li[hidden] { display: none; }
.more { margin-top: .9rem; background: none; border: 0; padding: .25rem 0; font: 500 .9375rem var(--sans); color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: .2em; }
.more:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.award-list li { display: grid; grid-template-columns: 3.75rem 1fr; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--rule); line-height: 1.35; }
.award-list li:last-child { border-bottom: 0; }
.award-title { font: 600 .9375rem/1.35 var(--sans); display: block; }
.award-detail { font: 400 .8125rem/1.4 var(--sans); color: var(--muted); display: block; margin-top: .1rem; }

/* ---------- publications ---------- */
.pubs { padding-top: 4rem; }
.pubs-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 2rem; }
.pubs-head h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters button {
  font: 500 .8125rem var(--sans); color: var(--muted); background: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: .35rem .85rem; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.filters button:hover { color: var(--ink); border-color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pubs-note { font: 400 .875rem var(--sans); color: var(--muted); margin: .6rem 0 1.75rem; }

.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1.75rem; }
.pub {
  display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper);
  transition: border-color .2s;
}
.pub:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
.pub[hidden] { display: none; }
.thumb { display: block; aspect-ratio: 16 / 9; background: var(--ph-1); border-bottom: 1px solid var(--rule); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; padding: 1rem; text-align: center; font: italic 400 1.875rem/1.1 var(--serif); color: var(--accent-ink); }
.pub-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .65rem; padding: 0; list-style: none; }
.tag { font: 600 .75rem/1 var(--sans); padding: .36rem .62rem; border-radius: 999px; white-space: nowrap; }
.tag-venue { background: var(--accent-soft); color: var(--accent-ink); }
.tag-oral, .tag-spotlight { background: var(--sage-soft); color: var(--sage-ink); }
.tag-poster, .tag-demo { color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule); }
.tag-award { background: var(--rose-soft); color: var(--rose-ink); display: inline-flex; gap: .3rem; align-items: center; }
.tag-award svg { width: .8rem; height: .8rem; }
.pub-title { font: 600 1.1875rem/1.35 var(--serif); margin: 0 0 .4rem; }
.pub-title a { color: var(--ink); text-decoration: none; }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font: 400 .875rem/1.55 var(--sans); color: var(--muted); margin: 0 0 .6rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-authors .etal { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: .2em; }
.pub-summary { font-size: .9688rem; line-height: 1.6; margin: 0 0 .9rem; }
.pub-links { margin-top: auto; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font: 500 .875rem var(--sans); }

.footer { padding: 4rem 2rem 3.5rem; font: 400 .875rem var(--sans); color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .masthead { grid-template-columns: minmax(0, 1fr) 12rem; gap: 2.5rem; }
  .split { grid-template-columns: 1fr; gap: 3rem; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .wrap { padding: 0 1rem; }
  .masthead { grid-template-columns: 1fr; padding-top: 2rem; gap: 1.5rem; }
  .portrait { position: static; order: 0; }
  .portrait img { width: 9rem; }
  .portrait .links { justify-content: flex-start; }
  .role { margin-bottom: 1.5rem; }
  .bio { font-size: 1.0625rem; }
  h2 { font-size: 1.625rem; }
  .statement { font-size: 1.1875rem; }
  .topbar nav { gap: 1rem; font-size: .875rem; }
  .topbar nav a[href="#awards"] { display: none; }
  .news-list li { grid-template-columns: 1fr; gap: 0; font-size: 1rem; }
  .pub-grid { grid-template-columns: 1fr; }
}

/* placeholder tiles, cycling */
.pub:nth-child(4n+2) .thumb { background: var(--ph-2); }
.pub:nth-child(4n+3) .thumb { background: var(--ph-3); }
.pub:nth-child(4n+4) .thumb { background: var(--ph-4); }
