/* shantanukhanna.com — single stylesheet, no external fonts or scripts */

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #5b6370;
  --rule: #e3e6ea;
  --accent: #1e3c72;
  --accent-hover: #2a5298;
  --tag-bg: #eef2f8;
  --focus: #2a6ae8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 58rem;   /* page width: header, footer and home layout (same on every page) */
  --reading: 48rem;   /* max line length for text pages, left-aligned under the site name */
}

:root {
  --panel: #f5f7fa;
  --btn-bg: #1e3c72;
  --btn-bg-hover: #2a5298;
  --btn-text: #ffffff;
}

/* Dark mode: soft slate rather than near-black, so it doesn't feel stark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c2028;
    --text: #dfe3e8;
    --muted: #a7afba;
    --rule: #323844;
    --accent: #a9c1ec;
    --accent-hover: #c8d7f3;
    --tag-bg: #283040;
    --focus: #8fb2ff;
    --panel: #232935;
    --btn-bg: #3a5a96;
    --btn-bg-hover: #4867a4;
    --btn-text: #ffffff;
  }
}

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

/* Type grows gently on large screens: 16px on phones/laptops, up to 19px on wide monitors */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: clamp(100%, 0.85rem + 0.3vw, 118.75%); }

/* Footer sits at the bottom of the window even on short pages */
body {
  min-height: 100vh; display: flex; flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent); color: var(--bg);
  padding: 0.5rem 1rem; z-index: 10; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 1.25rem; padding-bottom: 1rem;
}
.site-name {
  font: 600 1.3rem/1.2 var(--serif); color: var(--text); text-decoration: none;
}
.site-name:hover { color: var(--accent); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 0.25rem 0; display: inline-block; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }

/* ---------- Main ---------- */
main { flex: 1; padding: 2.5rem 0 3rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 1.5rem; }
h2 {
  font-size: 1.35rem; margin: 2.75rem 0 1rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
h2:first-child { margin-top: 0; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

/* ---------- Home ---------- */
/* Home page: wider than text pages, vertically centred in the window */
.home { display: flex; align-items: center; }
.home .wrap { width: 100%; }
main .wrap > :not(.intro) { max-width: var(--reading); }
.intro { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 44rem) { .intro { grid-template-columns: minmax(14rem, 19rem) 1fr; gap: 3rem; } }
.intro img { width: 100%; max-width: 19rem; border-radius: 6px; }
.intro h1 { font-size: 2.4rem; }
.intro h1 { margin-bottom: 0.25rem; }
.role { color: var(--muted); margin-bottom: 1.25rem; }
.affiliations {
  list-style: none; margin: 1.25rem 0; padding: 0.9rem 1.1rem;
  background: var(--panel); border-left: 3px solid var(--btn-bg); border-radius: 0 4px 4px 0;
}
.affiliations li { margin: 0.15rem 0; }

.icon {
  width: 1.05em; height: 1.05em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; width: 0.9em; height: 0.9em; }

.email { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.email a { text-decoration: none; }
.email a:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.6rem 1.15rem; border-radius: 6px; border: 1px solid transparent;
  font-weight: 500; font-size: 0.95rem; line-height: 1.2; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.btn-ghost { padding: 0.45rem 0.9rem; font-size: 0.9rem; color: var(--accent); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hover); background: var(--panel); }

/* Both button rows share one width: the block is as wide as its widest row,
   and each row's buttons stretch evenly to fill it, so the edges line up. */
.cta { display: inline-grid; gap: 0.6rem; margin-top: 1.5rem; max-width: 100%; }
.actions, .social { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.6rem; }
.social { list-style: none; padding: 0; margin: 0; }
.social .btn { width: 100%; white-space: nowrap; }
@media (max-width: 30rem) {
  .cta { display: grid; }
  .actions { grid-auto-flow: row; }
  .social .btn { padding-left: 0.5rem; padding-right: 0.5rem; }
  .social .long { display: none; }   /* "Scholar", "Twitter" on phones */
}

/* ---------- Lists of papers / items ---------- */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; }
.entry-title { font: 600 1.05rem/1.4 var(--sans); margin: 0 0 0.2rem; padding: 0; border: 0; }
.year, .tag { margin-right: 0.5rem; }
.entry-title a { text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }
.entry-meta { color: var(--muted); margin: 0; font-size: 0.97rem; }
.venue { font-style: italic; }
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--accent); background: var(--tag-bg);
  padding: 0.1rem 0.5rem; border-radius: 3px; margin-bottom: 0.35rem;
}
.year { display: inline-block; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.2rem; }

details { margin-top: 0.5rem; }
summary { cursor: pointer; color: var(--accent); font-size: 0.93rem; width: fit-content; }
summary:hover { color: var(--accent-hover); }
details p { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--muted); max-width: 42rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { padding-top: 1.25rem; padding-bottom: 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media print {
  .site-header nav, .site-footer, .skip-link { display: none; }
  details > p { display: block; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
