/* ==========================================================================
   mrsharan.com — editorial stylesheet
   Palette: white, red & charkha blue, with crimson here and there.
   Type: Fraunces (display) + Newsreader (text), self-hosted in ../fonts/
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --paper-2: #F6F6F8;
  --ink: #1B1B1D;
  --ink-2: #616166;
  --rule: #E7E7E9;
  --rule-dark: #CBCBCE;
  --red: #C1272D;          /* flag red */
  --crimson: #A51C30;      /* Harvard crimson */
  --red-deep: #7E1220;
  --chakra: #06038D;       /* Ashoka Chakra blue */
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --text: 'Newsreader', Georgia, 'Times New Roman', serif;
  --max: 1060px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--paper); scroll-behavior: smooth; }

body {
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  border-top: 5px solid var(--chakra); /* the charkha thread */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(6, 3, 141, 0.10); }

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

/* ---------- links ---------- */

a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(193, 39, 45, 0.35);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--red-deep); text-decoration-color: var(--red-deep); }

/* ---------- masthead ---------- */

.masthead-wrap { border-bottom: 1px solid var(--rule); }

.masthead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 1.1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--crimson); }

.masthead nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.masthead nav a {
  font-family: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 5px;
}
.masthead nav a:hover { color: var(--chakra); }
.masthead nav a.current {
  color: var(--chakra);
  border-bottom: 2px solid var(--chakra);
}
.masthead nav a .ext { font-size: 0.85em; }

/* ---------- layout ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* staggered page-load rise */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
main > * { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(5) { animation-delay: 0.24s; }
main > *:nth-child(6) { animation-delay: 0.30s; }
main > *:nth-child(7) { animation-delay: 0.36s; }
main > *:nth-child(n+8) { animation-delay: 0.42s; }

/* ---------- headings ---------- */

.kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chakra);
  margin-bottom: 0.9rem;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 1.2rem;
}

.sec {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3.2rem 0 0.4rem;
}
.sec::before {
  content: '';
  display: block;
  width: 2.6rem;
  height: 3px;
  border-radius: 2px;
  background: var(--red);
  margin-bottom: 0.85rem;
}
.subsec {
  font-family: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 2.4rem 0 0.2rem;
}

/* ---------- home ---------- */

.home-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.72fr;
  gap: 3.5rem;
  align-items: start;
}

.bio p { margin-bottom: 1.15rem; }
.bio p:last-child { margin-bottom: 0; }
.bio .lede {
  font-size: 1.24rem;
  line-height: 1.55;
  font-weight: 500;
}

.frame {
  background: #fff;
  border: 1px solid var(--rule-dark);
  padding: 7px;
  box-shadow: 0 14px 34px -18px rgba(29, 27, 26, 0.35);
}

.shelf { display: flex; gap: 0.75rem; margin-top: 1.2rem; }
.shelf a { display: block; }
.shelf img {
  height: 88px;
  width: auto;
  border: 1px solid var(--rule-dark);
  background: #fff;
  padding: 3px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.shelf a:hover img {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -12px rgba(29, 27, 26, 0.45);
}
.shelf-cap {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- publications ---------- */

.pub-list { list-style: none; border-top: 1px solid var(--rule); margin-top: 1.4rem; }

.pub { padding: 1.35rem 0; border-bottom: 1px solid var(--rule); }

.pub-title {
  font-family: var(--display);
  font-size: 1.17rem;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.005em;
}
.pub-title a { text-decoration: none; }
.pub-title a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; }

.pub-authors { margin-top: 0.3rem; font-size: 0.98rem; }
.pub-authors a { color: inherit; text-decoration-color: var(--rule-dark); }
.pub-authors a:hover { color: var(--red); }

.pub-meta { margin-top: 0.4rem; font-size: 0.95rem; color: var(--ink-2); }
.pub-meta .st {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-right: 0.35rem;
}

.pub-cov { margin-top: 0.35rem; font-size: 0.86rem; color: var(--ink-2); }
.pub-cov a { color: var(--ink-2); }
.pub-cov a:hover { color: var(--red); }

/* ---------- teaching / initiatives ---------- */

.course { margin-top: 2.6rem; padding-top: 2.4rem; border-top: 1px solid var(--rule); }
.course:first-of-type { margin-top: 1.6rem; }

.course h2 {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.course-meta { font-size: 0.95rem; color: var(--ink-2); margin-bottom: 1.1rem; }
.course p { margin-bottom: 1.05rem; max-width: 46rem; }

.note {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  max-width: 46rem;
}

/* ---------- writing / books ---------- */

.book {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 2.6rem;
  margin-top: 1.6rem;
  align-items: start;
}
.book p { margin-bottom: 1.05rem; }
.book-buy { font-size: 0.92rem; color: var(--ink-2); }

.dropcap::first-letter {
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.35em;
  float: left;
  line-height: 0.82;
  padding: 0.06em 0.09em 0 0;
  color: var(--crimson);
}

blockquote {
  border-left: 3px solid var(--crimson);
  padding: 0.15rem 0 0.15rem 1.25rem;
  margin: 1.4rem 0;
  font-style: italic;
  max-width: 44rem;
}
blockquote .cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.aside-figure {
  float: right;
  width: 250px;
  margin: 0.4rem 0 1.2rem 2.2rem;
}
.aside-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-2);
  font-style: italic;
}

/* ---------- podcast ---------- */

.pod-grid {
  display: grid;
  grid-template-columns: 265px 1fr;
  gap: 3rem;
  align-items: start;
  margin-top: 1.6rem;
}
.pod-grid p { margin-bottom: 1.1rem; }

.platforms { font-size: 0.8rem; letter-spacing: 0.13em; text-transform: uppercase; }
.platforms a { text-decoration: none; font-weight: 600; }
.platforms a:hover { text-decoration: underline; }
.platforms .dot { color: var(--rule-dark); margin: 0 0.45rem; }

.pod-embed { margin-top: 2.6rem; }
.pod-embed iframe { border: 0; border-radius: 12px; width: 100%; }

/* ---------- contact ---------- */

.contact-email {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
}
.contact-note { max-width: 44rem; margin-top: 1.8rem; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--rule); margin-top: 4rem; }
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem 2.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--red); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .home-grid, .book, .pod-grid { grid-template-columns: 1fr; gap: 2rem; }
  .home-photo { order: -1; max-width: 320px; }
  .book-cover { max-width: 210px; }
  .pod-cover { max-width: 240px; }
  .aside-figure { float: none; width: auto; max-width: 280px; margin: 1.4rem 0; }
}

@media (max-width: 720px) {
  .masthead { flex-direction: column; gap: 0.9rem; padding-top: 1.6rem; }
  main { padding-top: 2.2rem; }
}

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

/* compact article lists (Writing page) */
.pub-list--sm .pub { padding: 0.95rem 0; }
.pub-list--sm .pub-title { font-size: 1.05rem; }
