/* Debojyoti Ghosh -- site stylesheet. Hand-maintained; no build step. */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f6f7f9;
  --bg-inset:  #eef0f4;
  --fg:        #1c1f24;
  --fg-muted:  #596173;
  --fg-faint:  #7d8595;
  --accent:    #1f4bd8;
  --accent-dk: #16349b;
  --rule:      #dfe3ea;
  --rule-firm: #c4cad6;
  --measure:   72ch;
  --radius:    7px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #15171c;
    --bg-soft:   #1c1f26;
    --bg-inset:  #23262f;
    --fg:        #e7e9ee;
    --fg-muted:  #a7afc0;
    --fg-faint:  #8b93a5;
    --accent:    #8ba6ff;
    --accent-dk: #b3c4ff;
    --rule:      #2c3038;
    --rule-firm: #3c424e;
  }
}
:root[data-theme="dark"] {
  --bg:#15171c; --bg-soft:#1c1f26; --bg-inset:#23262f;
  --fg:#e7e9ee; --fg-muted:#a7afc0; --fg-faint:#8b93a5;
  --accent:#8ba6ff; --accent-dk:#b3c4ff; --rule:#2c3038; --rule-firm:#3c424e;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
}
.masthead__inner {
  max-width: 1080px; margin: 0 auto; padding: 1.15rem 1.25rem .65rem;
}
.masthead__name {
  margin: 0; max-width: none;
  font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2;
}
.masthead__name a { color: var(--fg); text-decoration: none; }
.masthead__name a:hover { color: var(--accent); }
.masthead__role {
  margin: .2rem 0 0; max-width: none; font-size: .93rem; color: var(--fg-muted);
}

/* ---------- nav ---------- */
.nav { margin-top: .85rem; }
.nav ul {
  display: flex; flex-wrap: wrap; gap: .2rem;
  margin: 0; padding: 0; list-style: none;
}
.nav a {
  display: block; padding: .4rem .8rem;
  font-size: .95rem; text-decoration: none; color: var(--fg-muted);
  border-radius: var(--radius); border: 1px solid transparent;
}
.nav a:hover { color: var(--fg); background: var(--bg-inset); }
.nav a[aria-current="page"] {
  color: var(--fg); background: var(--bg); border-color: var(--rule-firm); font-weight: 600;
}

/* ---------- layout ---------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 1.9rem 1.25rem 3rem; }
.pagehead { margin-bottom: 1.9rem; }
.pagehead h1 {
  margin: 0 0 .3rem; font-size: 1.95rem; font-weight: 650; letter-spacing: -.022em; line-height: 1.18;
}
.pagehead p { margin: 0; color: var(--fg-muted); font-size: 1.04rem; max-width: var(--measure); }

.cols { display: grid; grid-template-columns: minmax(0,1fr) 258px; gap: 2.6rem; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; gap: 2rem; } }

main { min-width: 0; }

/* ---------- typography ---------- */
h2 {
  margin: 2.3rem 0 .85rem; font-size: 1.22rem; font-weight: 650; letter-spacing: -.012em;
  padding-bottom: .35rem; border-bottom: 1px solid var(--rule);
}
h2:first-child { margin-top: 0; }
h3 { margin: 1.5rem 0 .5rem; font-size: 1.04rem; font-weight: 650; }
h4 { margin: 1.2rem 0 .4rem; font-size: .97rem; font-weight: 650; color: var(--fg-muted); }
p  { margin: 0 0 .9rem; max-width: var(--measure); }
ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; max-width: var(--measure); }
li { margin: 0 0 .36rem; }
li > ul, li > ol { margin: .36rem 0 .5rem; }
small { font-size: .87rem; color: var(--fg-muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-inset); padding: .12em .34em; border-radius: 4px; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- home ---------- */
.lede { font-size: 1.07rem; }
.portrait {
  width: 100%; max-width: 230px; height: auto; border-radius: var(--radius);
  border: 1px solid var(--rule); display: block;
}

.factgrid { display: grid; gap: .1rem 1rem; grid-template-columns: max-content 1fr; font-size: .95rem; margin: 0 0 1rem; }
.factgrid dt { color: var(--fg-faint); }
.factgrid dd { margin: 0; }

/* ---------- cards ---------- */
.cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); margin: 0 0 1rem; max-width: none; padding: 0; list-style: none; }
.card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .95rem 1.05rem; background: var(--bg-soft); margin: 0;
}
.card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.card p  { margin: 0; font-size: .93rem; color: var(--fg-muted); max-width: none; }

/* ---------- sidebar ---------- */
.side { font-size: .93rem; }
.side section { margin-bottom: 1.7rem; }
.side h2 {
  margin: 0 0 .55rem; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--fg-faint);
  border: 0; padding: 0;
}
.side ul { list-style: none; margin: 0; padding: 0; max-width: none; }
.side li { margin: 0; border-bottom: 1px solid var(--rule); }
.side li:last-child { border-bottom: 0; }
.side li a { display: block; padding: .33rem 0; }
.side p { max-width: none; font-size: .93rem; }

/* ---------- publications ---------- */
.pubnav {
  display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.6rem; padding: 0; list-style: none; max-width: none;
}
.pubnav li { margin: 0; }
.pubnav a {
  display: block; padding: .3rem .7rem; font-size: .88rem;
  border: 1px solid var(--rule-firm); border-radius: 999px; color: var(--fg-muted);
}
.pubnav a:hover { color: var(--fg); background: var(--bg-inset); text-decoration: none; }

.pubcount { font-size: .86rem; color: var(--fg-faint); font-weight: 400; }

ol.pubs { list-style: none; margin: 0 0 .6rem; padding: 0; max-width: none; counter-reset: none; }
ol.pubs > li {
  margin: 0 0 1.05rem; padding-left: 0; font-size: .96rem; line-height: 1.55;
}
.pub__title { font-style: italic; }
.pub__authors { }
.pub__self { font-weight: 650; }
.pub__cite { color: var(--fg-muted); }
.pub__also { display: block; color: var(--fg-muted); font-size: .92rem; margin-top: .12rem; }
.pub__links { margin-top: .2rem; font-size: .88rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.pub__links a {
  border: 1px solid var(--rule); border-radius: 4px; padding: .05rem .42rem; color: var(--fg-muted); background: var(--bg-soft);
}
.pub__links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.toplink { font-size: .85rem; }

/* ---------- inline citations ---------- */
.cite { font-size: .87em; color: var(--fg-faint); }
.cite a { color: var(--accent); }
.cite a:hover { color: var(--accent-dk); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 0 0 1.2rem; }
table { border-collapse: collapse; font-size: .94rem; min-width: 30rem; }
th, td { text-align: left; padding: .42rem .8rem .42rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 650; color: var(--fg-muted); font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; padding-right: 1.1rem; font-variant-numeric: tabular-nums; }

/* ---------- CV bits ---------- */
.role { margin: 1.35rem 0 .35rem; }
.role__title { font-weight: 650; }
.role__meta { color: var(--fg-muted); font-size: .93rem; }
.badge {
  display: inline-block; font-size: .76rem; font-weight: 650; letter-spacing: .03em;
  padding: .08rem .45rem; border-radius: 4px; background: var(--bg-inset); color: var(--fg-muted);
  border: 1px solid var(--rule); vertical-align: .08em;
}

/* ---------- video tickers (misc sidebar) ---------- */
.ticker {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  max-height: 41rem;
  margin: 0 0 .35rem;
  border-radius: var(--radius);
}
.ticker:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ticker__track {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
}
.vid { margin: 0; flex: 0 0 auto; border: 0; }
.vid a { display: block; color: var(--fg); text-decoration: none; padding: 0; }
.vid a:hover { text-decoration: none; }
.vid a:hover .vid__title { color: var(--accent); }
.vid__thumb {
  position: relative;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-inset);
  aspect-ratio: 16 / 9;
}
.vid__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vid a:hover .vid__thumb { border-color: var(--accent); }
.vid__dur {
  position: absolute;
  right: .28rem;
  bottom: .28rem;
  padding: .02rem .28rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.vid__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: .3rem;
  min-height: 2.6em;        /* two lines at line-height 1.3 */
  font-size: .83rem;
  line-height: 1.3;
  color: var(--fg-muted);
}
.ticker__more { font-size: .85rem; margin: 0; }

/* the sidebar's own list styling must not bleed into the ticker */
.side .ticker li { border-bottom: 0; padding: 0; }

/* ---------- gallery (misc) ---------- */
/* Two columns scoped to each year, so a year's albums stay together under
   their heading instead of flowing across the whole gallery. */
.albums { max-width: none; }
.year { margin: 0 0 1.6rem; }
.year h3 {
  margin: 0 0 .55rem;
  padding-bottom: .28rem;
  border-bottom: 1px solid var(--rule);
  font-size: .92rem;
  font-weight: 650;
  letter-spacing: .04em;
  color: var(--fg-faint);
}
.year ul {
  columns: 2 17rem;
  column-gap: 2.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}
.year li {
  margin: 0 0 .32rem;
  break-inside: avoid;        /* keep a wrapped entry in one column */
  -webkit-column-break-inside: avoid;
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule); margin-top: 1rem;
  padding: 1.1rem 1.25rem 2rem; font-size: .86rem; color: var(--fg-faint);
}
.foot__inner { max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }

/* ---------- print ---------- */
@media print {
  :root { --bg:#fff; --fg:#000; --fg-muted:#333; --rule:#bbb; }
  .nav, .side, .skip, .pubnav, .toplink, .foot { display: none !important; }
  body { font-size: 10.5pt; }
  .cols { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: none; }
  h2 { page-break-after: avoid; }
  ol.pubs > li, .role { page-break-inside: avoid; }
}
