/* drdeepakchawla.in — shared styles ("Journal" design) */

/* Fonts are hosted on this site (SIL Open Font License; see assets/fonts). */
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/libre-franklin-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/libre-franklin-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/libre-franklin-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/libre-franklin-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --paper: #ffffff;
  --ink: #111418;
  --ink-2: #3d434a;
  --muted: #555b61;
  --rule: #d8d8d8;
  --accent: #8a1c1c;
  --chip: #f3f1ee;
  --foot-bg: #111418;
  --foot-ink: #c9ccd0;
  --bar: #111418;
  --c1: #a32a2a;   /* chart series 1 (checked for colour-blind separation and contrast) */
  --c2: #2f74b5;   /* chart series 2 */
  --grid: #ebebeb;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121417;
    --ink: #ecebe8;
    --ink-2: #c4c7cb;
    --muted: #a3a8ae;
    --rule: #2e3237;
    --accent: #e58a8a;
    --chip: #1d2024;
    --foot-bg: #0a0b0d;
    --foot-ink: #a3a8ae;
    --bar: #3a3f45;
    --c1: #d06464;
    --c2: #4f90d0;
    --grid: #25292e;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 14px; font-family: var(--sans); font-size: 14px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; color: var(--paper); }

.bar { height: 8px; background: var(--bar); }
.wrap { padding-inline: var(--gutter); }
.inner { max-width: 1120px; margin-inline: auto; }

/* Masthead */
.masthead { padding: 28px 0 20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 40px; border-bottom: 1px solid var(--ink); }
.masthead .id { display: flex; flex-direction: column; gap: 8px; }
.kicker { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.name { margin: 0; font-family: var(--sans); font-size: clamp(36px, 6vw, 56px); font-weight: 800; letter-spacing: -0.025em; line-height: 1; }
.name a { text-decoration: none; color: inherit; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--sans); font-size: 14px; font-weight: 600; }
.nav a { text-decoration: none; padding: 6px 0; }
.nav a[aria-current="page"] { color: var(--accent); }

/* Sections */
.section { padding: 8px 0 56px; }
.split { display: flex; flex-wrap: wrap; gap: 48px 64px; }
.split > .major { flex: 7 1 420px; min-width: 0; }
.split > .minor { flex: 5 1 300px; min-width: 0; }
.ruled { border-top: 3px solid var(--ink); padding-top: 14px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.sec-head h2, .sec-title { margin: 0; font-family: var(--sans); font-size: 28px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.sec-head .num { color: var(--accent); font-size: 16px; margin-right: 12px; }
.sec-head .more, .more { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.label { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }

/* Intro */
.intro { padding: 56px 0; }
.standfirst { font-size: clamp(24px, 3vw, 32px); line-height: 1.3; margin-bottom: 24px; }
.bio { color: var(--ink-2); line-height: 1.65; }
.contents a, .contents .item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.contents .n { font-family: var(--sans); font-size: 14px; font-weight: 800; color: var(--accent); min-width: 24px; line-height: 1.6; }
.contents .t { display: block; font-family: var(--sans); font-size: 17px; font-weight: 600; line-height: 1.4; }
.contents .d { display: block; font-size: 15px; color: var(--muted); line-height: 1.5; }

/* Tool and teaching rows */
.trow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 32px; padding: 20px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.trow .tag { flex: 0 0 160px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.trow .tb { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trow .tt { font-family: var(--sans); font-size: 20px; font-weight: 600; line-height: 1.3; }
.trow .td { font-size: 16px; line-height: 1.55; color: var(--muted); }
.trow.has-icon { flex-wrap: nowrap; align-items: flex-start; }
.trow.has-icon .tb { flex: 1 1 auto; }
.trow.has-icon .tag { flex: none; }
.trow .ticon { flex: 0 0 72px; width: 72px; height: 72px; }
.ticon .i-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ticon .i-accent { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.ticon .i-dot { fill: var(--accent); }
@media (max-width: 560px) { .trow.has-icon { flex-wrap: wrap; } .trow .ticon { flex-basis: 56px; width: 56px; height: 56px; } }
.trow .tn { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 2px; }
.trow .go { font-family: var(--sans); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.trow:hover { color: inherit; }
.trow:hover .tt, .trow:hover .go { color: var(--accent); }

/* Ruled lists */
.rlist { list-style: none; margin: 16px 0 0; padding: 0; }
.rlist > li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.note { color: var(--muted); font-size: 16px; padding: 20px 0; border-bottom: 1px solid var(--rule); }

/* Big figure */
.figure { font-family: var(--sans); font-size: 72px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin: 28px 0 8px; }
.figure-cap { color: var(--ink-2); font-size: 17px; line-height: 1.5; margin-bottom: 4px; }
.metrics { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* Publication entries */
.pub { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pub .ti { font-weight: 600; font-size: 18px; line-height: 1.35; }
.pub .au { font-size: 15px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.pub .au strong { color: var(--ink); font-weight: 600; }
.pub .so { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.pub .so i { font-style: italic; }
.pub .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; font-family: var(--sans); font-size: 13px; }
.pub .tag { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pub .meta a { font-weight: 600; }
.pub .pos { color: var(--muted); }
.yr { margin: 36px 0 0; font-family: var(--sans); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }

/* Publication controls */
.controls { display: flex; flex-direction: column; gap: 14px; margin: 24px 0 8px; }
.search { display: flex; flex-direction: column; gap: 6px; max-width: 520px; font-family: var(--sans); font-size: 14px; font-weight: 600; }
.search input { font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 11px 12px; min-height: 46px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 13px/1 var(--sans); color: var(--ink); background: var(--chip); border: 1px solid transparent; padding: 0 14px; min-height: 40px; cursor: pointer; border-radius: 0; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .c { font-weight: 400; opacity: 0.8; margin-left: 4px; }
.status { font-family: var(--sans); font-size: 14px; color: var(--muted); min-height: 1.6em; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--sans); font-size: 14px; font-weight: 600; margin-top: 16px; }

/* About page */
.about .prose .bio { font-size: 19px; margin-bottom: 18px; max-width: 680px; }
.about .prose .bio:first-child { font-size: 22px; line-height: 1.5; color: var(--ink); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.facts-h { margin: 28px 0 0; }
.facts-h:first-child { margin-top: 4px; }
.facts { margin-top: 6px; }
.facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 16px; line-height: 1.45; padding: 9px 0; }
.facts .fy { flex: none; font-family: var(--sans); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Portrait (About page) */
.portrait { margin: 4px 0 8px; }
.portrait img { display: block; width: 100%; max-width: 340px; height: auto; border: 1px solid var(--rule); background: #f2f2f2; }

/* Forest-plot drawing (publications header) */
.pub-head { align-items: center; gap: 24px 64px; }
.pub-art { display: flex; justify-content: flex-end; }
.forest { display: block; width: 100%; max-width: 380px; height: auto; }
.forest path, .forest rect { vector-effect: non-scaling-stroke; }
.forest .f-label { fill: none; stroke: var(--rule); stroke-width: 3; stroke-linecap: round; }
.forest .f-null, .forest .f-axis { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.forest .f-ci { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; }
.forest .f-est { fill: var(--ink-2); }
.forest .f-pool { fill: var(--accent); fill-opacity: .16; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
@media (max-width: 760px) { .pub-art { justify-content: flex-start; } .forest { max-width: 300px; } }
@media (max-width: 560px) { .pub-art { display: none; } }

/* Charts (publications page) */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; margin-top: 20px; }
.chart { margin: 0; min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.ch-t { margin: 0; font-family: var(--sans); font-size: 18px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.ch-s { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 720px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 14px 0 4px; font-family: var(--sans); font-size: 13px; color: var(--ink-2); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.k1 { background: var(--c1); } .k2 { background: var(--c2); }
.sg.s1 { background: var(--c1); } .sg.s2 { background: var(--c2); }

/* Horizontal bars: label, bar, value at the tip. Buttons filter the list below. */
.hbars { display: grid; gap: 2px; margin-top: 14px; font-family: var(--sans); font-size: 14px; }
.hb, .sb { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); align-items: center; gap: 2px 14px; width: 100%; padding: 6px 6px; margin: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.hb { cursor: pointer; }
.hb:hover, .hb[aria-pressed="true"] { background: var(--chip); }
.hb[aria-pressed="true"] .hb-l { color: var(--ink); font-weight: 600; }
.hb-l { color: var(--ink-2); line-height: 1.3; }
.hb-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-bar, .sb-bar { flex: none; height: 14px; width: calc((100% - 4.5em) * var(--p)); min-width: 3px; border-radius: 0 4px 4px 0; }
.hb-bar { background: var(--c1); }
.sb-bar { display: flex; gap: 2px; overflow: hidden; }
.sb-bar .sg { min-width: 2px; }
.hb-v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-v { font-weight: 400; color: var(--ink-2); }
.ch-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.linkish { font: 600 14px/1.5 var(--sans); color: inherit; background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.linkish:hover { color: var(--accent); }
html:not(.js) .hb, html:not(.js) .linkish { pointer-events: none; }
html:not(.js) .ch-links { display: none; }

/* Year columns */
.vc { position: relative; margin-top: 12px; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.vc-plot { position: relative; height: 200px; margin-left: 30px; }
.vc-grid span { position: absolute; left: 0; right: 0; bottom: calc(var(--t) * 100%); border-top: 1px solid var(--grid); }
.vc-grid span:first-child { border-top-color: var(--ink-2); }
.vc-grid span::before { content: attr(data-v); position: absolute; right: calc(100% + 8px); top: -0.75em; line-height: 1.5; font-variant-numeric: tabular-nums; }
.vc-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.vc-col { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; height: 100%; padding-bottom: 1px; text-decoration: none; }
.vc-col .sg { width: min(22px, 72%); height: calc(var(--v) / var(--max) * 100% - 2px); transition: opacity .15s; }
.vc-col .sg.top { border-radius: 4px 4px 0 0; }
.vc-cols:hover .vc-col:not(:hover) .sg { opacity: 0.45; }
.vc-col:focus-visible { outline-offset: 0; }
.vc-x { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin: 8px 0 0 30px; }
.vc-x span { justify-self: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vc-tip { position: absolute; z-index: 2; pointer-events: none; padding: 4px 8px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: 3px; }
.tableview { margin-top: 14px; font-family: var(--sans); font-size: 13px; }
.tableview summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tableview table { border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { padding: 3px 14px 3px 0; text-align: right; border-bottom: 1px solid var(--rule); }
.tableview th[scope="row"], .tableview thead th:first-child { text-align: left; }
.ch-note { margin-top: 32px; max-width: 820px; }

@media (max-width: 860px) {
  .charts { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}
@media (max-width: 520px) {
  .hb, .sb { grid-template-columns: minmax(0, 1fr); }
  .vc-plot { height: 170px; }
}

/* Funded research */
.grant { display: flex; flex-wrap: wrap; gap: 6px 32px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.grant .ag { flex: 0 0 120px; font-family: var(--sans); font-size: 15px; font-weight: 800; }
.grant .gb { flex: 1 1 420px; min-width: 0; }
.grant .gt { font-weight: 600; font-size: 18px; line-height: 1.35; }
.grant .gm { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.grant .on { color: var(--accent); font-weight: 600; }

/* Footer */
.foot { background: var(--foot-bg); color: var(--foot-ink); margin-top: 8px; }
.foot .inner { padding: 28px 0 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 40px; font-family: var(--sans); font-size: 13px; line-height: 1.6; }
.foot p { max-width: 640px; }
.foot a { color: var(--foot-ink); }

[hidden] { display: none !important; }

@media print {
  .bar, .nav, .controls, .foot, .skip { display: none !important; }
  body { font-size: 11pt; }
  .pub { break-inside: avoid; }
}
