/* Deblina Bhattacharjee — site styles
   Palette: paper, ink (navy), cobalt, mustard, a pinch of vermilion.
   Type: Bricolage Grotesque (display, UI) + Source Serif 4 (reading). */

:root {
  --paper: #ffffff;
  --paper-2: #f3f4f8;
  --ink: #1c1f2e;
  --ink-soft: #4a4f63;
  --grey: #8a8fa3;
  --rule: #d9dbe4;
  --cobalt: #2a50b4;
  --cobalt-ink: #1f3d8f;
  --mustard: #e6b422;
  --vermilion: #d9412b;
  --sand: #f6efe3;
  --apricot: #fbe9d7;
  --straw: #f8efcf;
  --clay: #f1dfd3;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --panel-border: 2.5px solid var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "opsz" 17;
}

h1, h2, h3, h4, .display { font-family: var(--display); line-height: 1.05; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-ink); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; border-radius: 2px; }
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--sand) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--cobalt); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink-soft);
  padding: 8px 10px; border-radius: 6px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 5vw, 64px); background: var(--sand); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: clamp(24px, 5vw, 64px); align-items: start; }
.portrait { margin-top: clamp(8px, 2vw, 24px); }
.hero h1 {
  font-size: clamp(40px, 6.6vw, 80px);
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 90, "opsz" 96;
  line-height: 0.95;
  margin-bottom: 0.3em;
}
.hero h1 span { display: block; }
.hero .role {
  font-family: var(--display); font-weight: 500; font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft); margin-bottom: 1.4em; max-width: 36ch;
}
.hero .lede { font-size: clamp(19px, 2vw, 23px); line-height: 1.4; max-width: 30ch; margin-bottom: 0.9em; font-variation-settings: "opsz" 24; }
.hero .bio { max-width: 58ch; color: var(--ink-soft); }
.hero .bio p { margin-bottom: 0.7em; }
.portrait { border: var(--panel-border); background: #fff; overflow: hidden; }
.portrait img { width: 100%; height: auto; display: block; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; font-family: var(--display); font-size: 15px; font-weight: 500; }
.hero-links a { color: var(--ink); border-bottom: 2px solid var(--mustard); padding-bottom: 1px; }
.hero-links a:hover { text-decoration: none; color: var(--cobalt); border-color: var(--cobalt); }

/* ---------- talk photos ---------- */
.photos {
  display: grid; gap: 12px; margin-bottom: clamp(24px, 3vw, 36px);
  grid-template-columns: 4fr 5fr 3fr; grid-template-rows: repeat(4, 150px);
  grid-template-areas: "un ai4va cvpr" "un ai4va cvpr" "un sac unrisd" "un sac unrisd";
}
.photos figure { margin: 0; position: relative; overflow: hidden; border: var(--panel-border); background: var(--paper-2); }
.photos .p-un { grid-area: un; } .photos .p-ai4va { grid-area: ai4va; } .photos .p-sac { grid-area: sac; }
.photos .p-cvpr { grid-area: cvpr; } .photos .p-unrisd { grid-area: unrisd; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .p-un img { object-position: 50% 55%; }
.photos .p-cvpr img { object-position: 55% 40%; }
.photos .p-unrisd img { object-position: 40% 30%; }
.photos .p-sac img { object-position: 60% 50%; }
.photos figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  font-family: var(--display); font-size: 13px; font-weight: 500; line-height: 1.25; color: #fff;
  background: linear-gradient(transparent, rgba(28,31,46,.78) 45%);
}

/* ---------- sections ---------- */
section { padding: clamp(44px, 6vw, 80px) 0; scroll-margin-top: 56px; }
section + section { border-top: 1px solid var(--rule); }
#news { background: var(--apricot); }
#teaching { background: var(--sand); }
#awards { background: var(--straw); }
#talks { background: var(--clay); }
#news, #teaching, #awards, #talks { border-top: 0; }
#news + section, #teaching + section, #awards + section, #talks + section { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(20px, 3vw, 36px); flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; letter-spacing: -0.025em; }
.section-head p { font-family: var(--display); color: var(--grey); font-size: 15px; margin: 0; }

/* ---------- research panels (comic-page grid) ---------- */
.panels { display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); grid-auto-rows: auto; }
.panel { border: var(--panel-border); background: var(--paper); display: flex; flex-direction: column; min-width: 0; }
.panel.wide { grid-column: span 4; }
.panel.narrow { grid-column: span 2; }
.panel.half { grid-column: span 3; }
.panel .art { aspect-ratio: 1600 / 808; overflow: hidden; border-bottom: var(--panel-border); background: #fff; }
.panel.narrow .art { aspect-ratio: 16 / 9; }
.panel.half .art { aspect-ratio: 1600 / 496; }
.panel.half .art.card { aspect-ratio: 1600 / 770; }
.panel .art img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.panel .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.panel h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.panel p { color: var(--ink-soft); font-size: 16px; margin: 0; }
.panel .papers { margin-top: auto; padding-top: 8px; font-family: var(--display); font-size: 14px; line-height: 1.5; }
.panel .papers a { color: var(--ink); }
.panel .papers a + a::before { content: " / "; color: var(--grey); }
.panel .papers a:hover { color: var(--cobalt); text-decoration: none; }
.panel .partner { font-family: var(--display); font-size: 13px; color: var(--grey); }
.strands-note { margin-top: 18px; font-family: var(--display); font-size: 15px; color: var(--ink-soft); max-width: 80ch; }

/* ---------- news ---------- */
.news { max-width: 820px; }
.news li { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 12px 0; border-top: 1px solid rgba(28,31,46,.12); }
.news li:first-child { border-top: 0; padding-top: 0; }
.news time { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--grey); padding-top: 3px; }
.news p { margin: 0; }
details.more summary {
  cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--cobalt);
  list-style: none; padding: 14px 0 0; display: inline-block;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " +"; }
details.more[open] summary::after { content: " \2212"; }
details.more[open] summary { margin-bottom: 8px; }

/* ---------- publications ---------- */
.pub-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-controls button {
  font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: 1.5px solid var(--ink); padding: 6px 12px; cursor: pointer; border-radius: 999px;
}
.pub-controls button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pubs .year { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--grey); margin: 28px 0 10px; letter-spacing: 0.02em; }
.pub { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--rule); align-items: start; }
.pub.hidden { display: none; }
.pub .thumb { aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2); border: 1.5px solid var(--ink); }
.pub .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub .tile { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: #fff; background: var(--cobalt); text-align: center; padding: 6px; line-height: 1; }
.pub .tile.m { background: var(--mustard); color: var(--ink); }
.pub .tile.i { background: var(--ink); }
.pub h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--cobalt); text-decoration: none; }
.pub .authors { font-size: 15px; color: var(--ink-soft); margin: 4px 0 2px; }
.pub .authors b { font-weight: 600; color: var(--ink); }
.pub .venue { font-family: var(--display); font-size: 14px; color: var(--grey); }
.pub .venue em { font-style: normal; color: var(--vermilion); font-weight: 600; }
.pub .links { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--display); font-size: 14px; font-weight: 600; }
.pub-more { margin-top: 18px; }

/* ---------- compact columns (teaching, service, awards, talks) ---------- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 36px; }
.cols.two { grid-template-columns: repeat(2, 1fr); }
.col h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.015em; }
.col li { padding: 6px 0; border-top: 1px solid rgba(28,31,46,.12); font-size: 15.5px; color: var(--ink-soft); }
.col li:first-child { border-top: 0; padding-top: 0; }
.col li strong { color: var(--ink); font-weight: 600; }
.col p { color: var(--ink-soft); font-size: 16px; }
.stat { font-family: var(--display); font-weight: 800; font-size: 36px; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.stat small { display: block; font-size: 14px; font-weight: 500; color: var(--grey); margin-top: 4px; letter-spacing: 0; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 20px; margin-bottom: 14px; }

/* ---------- outreach ---------- */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.gallery figure { margin: 0; border: var(--panel-border); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { font-family: var(--display); font-size: 14px; padding: 8px 10px; border-top: var(--panel-border); color: var(--ink-soft); }

/* ---------- footer ---------- */
footer { border-top: 2.5px solid var(--ink); padding: 36px 0 48px; background: var(--sand); }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
footer h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
footer p { color: var(--ink-soft); max-width: 48ch; }
.email { font-family: var(--display); font-weight: 600; }
.email::after { content: attr(data-u) "\0040" attr(data-d); }
.social { display: flex; flex-wrap: wrap; gap: 8px 16px; font-family: var(--display); font-weight: 600; font-size: 15px; }
footer small { display: block; width: 100%; color: var(--grey); font-family: var(--display); font-size: 13px; margin-top: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .photos { grid-template-rows: repeat(4, 120px); }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .panel.wide, .panel.narrow, .panel.half { grid-column: span 6; }
  .cols, .cols.two { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .photos { grid-template-columns: 1fr 1fr; grid-template-rows: 220px 170px 220px; grid-template-areas: "un ai4va" "un sac" "cvpr unrisd"; }
  body { font-size: 16px; }
  .brand { font-size: 15px; }
  .topbar .wrap { gap: 8px; }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { max-width: none; order: -1; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .pub { grid-template-columns: 1fr; gap: 10px; }
  .pub .thumb { max-width: 240px; }
  .cols, .cols.two { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
