/* Islamul Haque — academic site stylesheet */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --muted: #5d6068;
  --line: #e4e1da;
  --accent: #00356b;      /* Yale blue */
  --accent-soft: #e8eef6;
  --tag: #f1efe9;
  --measure: 46rem;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header .inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 1.6rem; font-size: 0.95rem; }
.nav a { color: var(--muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Layout */
main { max-width: 64rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.measure { max-width: var(--measure); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin: 3rem 0 1.1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
h2:first-of-type { margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--muted); font-family: var(--font-serif); margin-bottom: 1.4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* Home hero */
.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}
.hero .photo img {
  width: 220px; height: 260px; object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08);
}
.hero .photo .placeholder {
  width: 220px; height: 260px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; text-align: center; padding: 1rem;
}
.hero .title { font-size: 1.05rem; color: var(--muted); margin: 0.4rem 0 1.2rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.links a {
  display: inline-block; padding: 0.42rem 0.9rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 0.92rem;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.links a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.links a.primary:hover { background: #002a55; color: #fff; }

/* Cards */
.card {
  background: var(--accent-soft);
  border-top: 3px solid var(--accent);
  padding: 1.4rem 1.6rem 1.5rem;
  margin: 0 0 1.5rem;
}
.card .kicker {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 0.5rem;
}

/* Fields / two-column info */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  margin-top: 2.5rem;
}
.info-grid dl { margin: 0; }
.info-grid dt { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
.info-grid dt:first-child { margin-top: 0; }
.info-grid dd { margin: 0.2rem 0 0; }

/* Papers */
.paper { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: none; }
.paper h3 { margin-bottom: 0.3rem; }
.paper h3 a { color: var(--ink); }
.paper h3 a:hover { color: var(--accent); }
.paper .meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.4rem; }
.paper .summary { margin-bottom: 0.6rem; }
.tag {
  display: inline-block; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--tag); color: var(--muted); padding: 0.15rem 0.55rem; border-radius: 3px;
  margin-left: 0.4rem; vertical-align: middle; font-weight: 600;
}
.tag.jmp { background: var(--accent); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.92rem; align-items: center; }
.actions a { font-weight: 500; }
details { margin-top: 0.5rem; }
details summary {
  cursor: pointer; color: var(--accent); font-size: 0.92rem; font-weight: 500;
  list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; font-weight: 600; width: 0.9em; display: inline-block; }
details[open] summary::before { content: "–"; }
details .abstract { margin-top: 0.6rem; padding: 0.9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 0.97rem; }
details .abstract p:last-child { margin-bottom: 0; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }

/* Teaching */
.course { padding: 0.9rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
.course:last-child { border-bottom: none; }
.course .term { color: var(--muted); font-size: 0.92rem; padding-top: 0.15rem; }
.course .name { font-weight: 600; }

/* CV */
.cv-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; margin-top: 1.2rem; }
.cv-section { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.cv-section:last-child { border-bottom: none; }
.cv-section .when { color: var(--muted); font-size: 0.92rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer .inner {
  max-width: 64rem; margin: 0 auto; padding: 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 720px) {
  main { padding: 2rem 1.2rem 3rem; }
  h1 { font-size: 1.9rem; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero .photo img, .hero .photo .placeholder { width: 160px; height: 190px; }
  .info-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .course, .cv-section { grid-template-columns: 1fr; gap: 0.2rem; }
  .nav { gap: 1.1rem; }
}
@media print {
  .site-header, .site-footer, .links, .actions { display: none; }
  body { background: #fff; }
}
