/* ---------- Raghu Ananthanarayanan — shared site styles ---------- */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --ink: #211d19;
  --ink-soft: #5b564f;
  --accent: #8a3b2b;   /* muted terracotta/maroon */
  --accent-soft: #b98a3e; /* ochre for rules/highlights */
  --line: #ececec;
  --max-width: 860px;
  --sticky-offset: 110px; /* kept in sync with the live header+pills height via JS */
}

* { box-sizing: border-box; }
/* Note: deliberately NOT setting scroll-behavior:smooth globally here.
   It conflicts with JS-driven scrollIntoView()/scrollTo() calls (nav.js
   controls smoothness explicitly per-call instead) and was observed to
   silently cancel programmatic scrolls when both were active at once. */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Georgia', 'Iowan Old Style', serif;
  line-height: 1.72;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
  letter-spacing: -.01em;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }

p { margin: 0 0 1.15em 0; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */

header.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  transition: box-shadow .2s ease;
}
header.site-header.is-compact { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: padding .2s ease;
}
header.site-header.is-compact .header-inner { padding: 14px 24px; gap: 4px; }
header.site-header.is-compact .site-tagline { display: none; }
header.site-header.is-compact nav.site-subnav { display: none; }
header.site-header.is-compact .nav-burger { display: flex; }
header.site-header.is-compact nav.site-nav { display: none; }
header.site-header.is-compact nav.site-nav.open {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 14px 24px 20px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(0,0,0,.06);
}

.site-title {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.3rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
}
.site-title a { color: inherit; border-bottom: none; }

.site-tagline {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 0;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-burger {
  display: none;
  width: 26px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .15s ease, opacity .15s ease;
}
.nav-burger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-burger.active span:nth-child(2) { opacity: 0; }
.nav-burger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

nav.site-nav a {
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
nav.site-nav a.active,
nav.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

nav.site-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--ink-soft);
}
nav.site-subnav a { color: var(--ink-soft); border-bottom: none; }
nav.site-subnav a.active,
nav.site-subnav a:hover { color: var(--accent); }
nav.site-subnav .sep { display:none; }

/* ---------- In-page section nav (jump links) ---------- */

.page-nav {
  margin: 0 0 50px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 60px; /* sits just below the compact sticky header once both are stuck */
  background: var(--bg);
  z-index: 10;
}
.page-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.page-nav a {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
}
.page-nav a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}
.page-nav a.active {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: rgba(184, 134, 43, .1);
}

.intro-lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin-bottom: 36px;
}
.intro-lede strong { color: var(--ink); }

section.bio-part {
  scroll-margin-top: var(--sticky-offset);
  padding-top: 6px;
}
section.bio-part h2 {
  font-size: 1.35rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
section.bio-part .kicker {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: block;
}

/* ---------- Guru photo section ---------- */

.guru-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin: 20px 0 26px;
}
.guru-grid figure { margin: 0; }
.guru-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.guru-grid figcaption {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  color: var(--ink-soft);
  margin-top: 6px;
  text-align: center;
}

/* ---------- Section illustrations (Part I&ndash;V images) ---------- */

.section-image-wrap {
  margin: 20px 0 26px;
  text-align: center;
}
.section-image-wrap img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.image-credit {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  color: var(--ink-soft);
  margin-top: 8px;
  text-align: center;
}

.section-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  margin: 20px 0 30px;
  flex-wrap: wrap;
}
.section-hero-photo,
.section-hero-photo-wrap {
  flex: 1 1 240px;
  max-width: 300px;
  width: 100%;
  margin: 0;
}
.section-hero-photo {
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: block;
}
.section-hero-photo-wrap .section-hero-photo { width: 100%; }
.section-hero-photo-wrap .image-credit { text-align: left; }
.section-hero-photo-wrap.tall { flex-basis: 260px; max-width: 340px; }
.section-hero-text { flex: 2 1 320px; min-width: 240px; }
.section-hero-text p:last-child { margin-bottom: 0; }

.float-image-right {
  float: right;
  width: 220px;
  max-width: 45%;
  margin: 4px 0 16px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

.section-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  margin: 20px 0 26px;
  max-width: 420px;
}
.section-image-grid img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

/* ---------- Floated portraits beside the paragraph mentioning them ---------- */

.people-float {
  float: right;
  width: 280px;
  max-width: 46%;
  margin: 4px 0 20px 26px;
}
.people-float.float-left {
  float: left;
  margin: 4px 26px 20px 0;
}
.people-float img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: block;
}
.people-float figcaption {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  color: var(--ink-soft);
  margin-top: 6px;
  text-align: center;
}
.people-float-pair {
  width: 280px;
  max-width: 46%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.people-float-pair figure { margin: 0; }

.people-float.no-frame img {
  aspect-ratio: auto;
  object-fit: contain;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: none;
}

.people-float.compact {
  width: 200px;
  max-width: 38%;
}

/* ---------- Centred pair, not floated, sits between paragraphs ---------- */

.people-center-pair {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 26px 0;
}
.people-center-pair figure {
  width: 200px;
  margin: 0;
}
.people-center-pair img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: block;
}
.people-center-pair figcaption {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  color: var(--ink-soft);
  margin-top: 6px;
  text-align: center;
}

/* ---------- Simple link lists (podcasts, bedtime stories, medium) ---------- */

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: .95rem;
}
.link-list li:first-child { padding-top: 0; }

/* ---------- Main ---------- */

main { padding: 52px 0 90px; }

.hero { display: flex; gap: 32px; align-items: center; margin-bottom: 56px; flex-wrap: wrap; }

.hero-photo {
  flex: 1 1 320px;
  max-width: 380px;
  width: 100%;
  aspect-ratio: 800 / 574;
  border-radius: 14px;
  object-fit: cover; background: var(--bg-soft);
  border: 1px solid var(--line);
}

.hero-text { flex: 1 1 280px; min-width: 240px; }
.hero-text h1 { font-size: 1.9rem; margin-bottom: 8px; }
.hero-text .role { font-family: Georgia, serif; color: var(--ink-soft); font-style: italic; font-size: 1.02rem; margin-bottom: 14px; }
.hero-text .intro-lede { margin-bottom: 0; }

section { margin-bottom: 56px; }
section > h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
  color: var(--ink-soft);
}

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; }
.pillar { padding: 0; }
.pillar h3 { font-size: 1rem; color: var(--accent); margin-bottom: 6px; }
.pillar p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

blockquote {
  border-left: 2px solid var(--accent-soft);
  margin: 0 0 1.2em 0;
  padding: 2px 0 2px 20px;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Cards (Books) ---------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; }

.card { display: flex; flex-direction: column; }
.card .cover { width: 100%; max-width: 130px; border-radius: 2px; margin-bottom: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.10); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card .desc { font-size: .93rem; color: var(--ink-soft); flex-grow: 1; }
.card .desc p { margin: 0; }
.card .buy {
  align-self: flex-start; margin-top: 12px; font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700;
}

/* ---------- Papers ---------- */

.paper-item { border-bottom: 1px solid var(--line); padding: 26px 0; }
.paper-item:first-child { padding-top: 0; }
.paper-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.paper-item .meta {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px;
}
.paper-item p { font-size: .96rem; color: var(--ink-soft); margin-bottom: 10px; }
.paper-item .dl {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}

/* ---------- Blog ---------- */

.blog-post { border-bottom: 1px solid var(--line); padding: 32px 0; }
.blog-post:first-child { padding-top: 0; }
.blog-post h3 { font-size: 1.3rem; margin-bottom: 4px; }
.blog-post .meta {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px;
}
.blog-post .excerpt { color: var(--ink-soft); }
.blog-post .full { display: none; }
.blog-post.expanded .full { display: block; }
.blog-post.expanded .excerpt { display: none; }

.read-more-btn {
  background: none; border: none; color: var(--accent);
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  cursor: pointer; padding: 0; border-bottom: 1px solid var(--accent-soft);
}
.read-more-btn:hover { color: #5c2820; }

.blog-external { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.blog-external ul { padding-left: 20px; }
.blog-external li { margin-bottom: 8px; }

.loading-note { color: var(--ink-soft); font-style: italic; font-size: .9rem; }

/* ---------- Nav FAB (bottom-right floating button) ----------
   Doubles as "back to top" and a quick page-navigation menu (Home
   and, on the About page, the section pills) so mobile doesn't need
   its own separate sticky/dropdown nav for jumping around the page.
------------------------------------------------------- */

.nav-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  box-shadow: 0 3px 14px rgba(0,0,0,.28);
  transition: opacity .18s ease, transform .18s ease, background .15s ease, box-shadow .15s ease;
  z-index: 20;
}
.nav-fab.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-fab:hover { background: #5c2820; box-shadow: 0 5px 18px rgba(0,0,0,.35); }

.nav-fab-menu {
  position: fixed;
  bottom: 90px;
  right: 28px;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 56px));
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 20;
}
.nav-fab-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-fab-menu a,
.nav-fab-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .82rem;
  color: var(--ink-soft);
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  border-bottom: none;
}
.nav-fab-menu a:hover,
.nav-fab-menu button:hover { background: var(--bg-soft); color: var(--accent); }
.nav-fab-menu .menu-current { color: var(--accent); }
.nav-fab-menu .menu-sep { border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  text-align: center;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: .8rem;
  color: var(--ink-soft);
}
footer.site-footer a { color: var(--ink-soft); }

@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: flex-start; }
  body { font-size: 16px; }
  .people-float,
  .people-float.float-left,
  .people-float-pair {
    float: none;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 16px;
  }
  .people-center-pair {
    flex-direction: column;
    align-items: center;
  }
  .people-center-pair figure {
    width: 100%;
    max-width: 220px;
  }
  .nav-burger { display: flex; }
  nav.site-nav {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }
  nav.site-nav.open { display: flex; }

  /* Section pills are dropped on mobile in favour of the nav FAB
     (bottom-right button), which lists Home/sections in a menu
     instead of a second sticky bar competing with the header. */
  .page-nav { display: none; }
}
