img {
  border-radius: 5%;
}

.jumbotron {
  padding: 1.25rem;
  padding-bottom: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.navbar {
  margin-bottom: 1.25rem;
  border-bottom: 4px solid var(--secondary);
}

.btn {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
  max-width: 800px;
}

.container-footer {
  margin-right: auto;
  margin-left: auto;
  max-width: 800px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.well-collapse {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
  border-radius: 7px;
  min-height: 1px;
  margin-top: 1rem;
  color: black;
  background-color: var(--gray);
  border: 2px solid var(--gray-dark);
}
.well-collapse blockquote {
  border-color: var(--gray-dark);
  border-color: rgba(0, 0, 0, 0.15);
}

.embed-container-home {
  position: relative;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("https://shivaram.net/images/thumbs/3dtrain.jpeg");
}

.embed-container {
  position: relative;
  padding: 0;
  margin: 0;
  width: 175px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.embed-container-spleen {
  height: 155px;
  background-image: url("https://shivaram.net/images/thumbs/spleen.jpg");
}

.embed-container-leuk {
  height: 112px;
  background-image: url("https://shivaram.net/images/thumbs/spleen.jpg");
}

.MathJax_ref {
  fill: #4ec9d4 !important;
}

/* ===========================================================================
   Cool cyan theme components  (cyan #3ab0d1 · teal #4ec9d4 · grey-black #1c1c1e)
   =========================================================================== */
/* --- Social / contact icons --- */
.social-icons {
  margin: 0.5rem 0 0.25rem;
  line-height: 1;
}
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4ec9d4;
  margin: 0 1.25rem 0 0;
  transition: color 0.15s ease;
}
.social-icons a:hover {
  color: #3ab0d1;
  text-decoration: none;
}
.social-icons {
  /* drop trailing margin so a centered row stays visually centered */
}
.social-icons a:last-child {
  margin-right: 0;
}

.social-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
}

.social-icon-lg {
  font-size: 2rem;
}

/* the sidebar wraps this in <center>, which centers the inline-block icons for free */
/* --- Calendly "Book a meeting" button (discrete / ghost) --- */
.calendly-cta {
  margin: 0.75rem 0 0.25rem;
}

.btn-book {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  color: #e5e5ea !important;
  background: transparent;
  border: 1px solid #3a3a3c;
  text-decoration: none;
}
.btn-book:hover {
  color: #3ab0d1 !important;
  border-color: #3ab0d1;
  text-decoration: none;
}

/* --- Navbar search (Fuse.js) --- */
.nav-search {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.nav-search .search-icon {
  position: absolute;
  left: 12px;
  color: #8e8e93;
  pointer-events: none;
  font-size: 0.875rem;
}
.nav-search input {
  background: #1c1c1e;
  border: 1px solid #3a3a3c;
  color: #e5e5ea;
  border-radius: 18px;
  padding: 0.5rem 1rem 0.5rem 2rem;
  width: 190px;
  outline: none;
  transition: border-color 0.15s ease, width 0.15s ease, box-shadow 0.15s ease;
}
.nav-search input::placeholder {
  color: #8e8e93;
}
.nav-search input:focus {
  border-color: #3ab0d1;
  width: 230px;
  box-shadow: 0 0 0 2px rgba(58, 176, 209, 0.25);
}

@media (max-width: 767px) {
  .nav-search {
    margin: 0.5rem 0 0.25rem;
  }
  .nav-search input, .nav-search input:focus {
    width: 100%;
  }
}
/* Rich search dropdown */
.search-panel {
  display: none;
  position: absolute;
  top: 124%;
  right: 0;
  width: 420px;
  max-width: 88vw;
  max-height: 70vh;
  overflow-y: auto;
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  z-index: 1050;
}
.search-panel.open {
  display: block;
}

.search-count {
  padding: 0.5rem 1rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8e8e93;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-count:empty {
  display: none;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
}
.search-results li {
  margin: 0;
}
.search-results a {
  display: block;
  padding: 0.75rem 0.75rem;
  border-radius: 8px;
  color: #e5e5ea;
  text-decoration: none;
}
.search-results .sr-item.active > a,
.search-results .sr-item > a:hover {
  background: rgba(58, 176, 209, 0.16);
}
.search-results .sr-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-results .sr-icon {
  color: #4ec9d4;
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
  flex: none;
}
.search-results .sr-title {
  font-weight: 600;
  flex: 1 1 auto;
}
.search-results .sr-badge {
  flex: none;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8e8e93;
  border: 1px solid #3a3a3c;
  border-radius: 5px;
  padding: 0 0.5rem;
}
.search-results .sr-snippet {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #e5e5ea;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-results .sr-meta {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.75rem;
  color: #8e8e93;
}
.search-results mark, .search-results .mark {
  background: rgba(58, 176, 209, 0.32);
  color: #fff;
  padding: 0 0;
  border-radius: 2px;
}
.search-results .search-empty {
  padding: 1rem;
  color: #8e8e93;
}

/* --- Blog: media in post content --- */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.post-content pre, .post-content code {
  border-radius: 6px;
}

.post-figure, .post-video, .post-gif {
  margin: 1.5rem auto;
  text-align: center;
}
.post-figure img, .post-figure video, .post-video img, .post-video video, .post-gif img, .post-gif video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.post-figure figcaption, .post-video figcaption, .post-gif figcaption {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: #8e8e93;
  font-style: italic;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 8px;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Timeline feed: cards --- */
.post-list {
  margin-top: 0.75rem;
}

.post-card {
  position: relative;
  padding: 0 0 1.25rem 1.5rem;
  margin-bottom: 0;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.375rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ec9d4;
}
.post-card .post-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}
.post-card .post-card-title a {
  color: #e5e5ea;
}
.post-card .post-card-title a:hover {
  color: #3ab0d1;
  text-decoration: none;
}
.post-card .post-card-meta {
  margin: 0 0 0.375rem;
  font-size: 0.875rem;
  color: #8e8e93;
}
.post-card .post-card-excerpt {
  margin: 0;
  line-height: 1.6;
}
.post-card .post-card-more {
  color: #4ec9d4;
  font-weight: 600;
}
.post-card .post-card-more:hover {
  color: #3ab0d1;
  text-decoration: none;
}

.post-back a {
  color: #8e8e93;
}
.post-back a:hover {
  color: #3ab0d1;
}

/* ===========================================================================
   Typography — Apple fonts. Lucida Grande for headings/nav/UI, San Francisco
   for body copy. (Overrides the Bootswatch "Lato" default.)
   =========================================================================== */
:root {
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, SF Pro Text, SF Pro Display, Helvetica Neue, Helvetica, Arial, sans-serif;
}

/* Body copy → San Francisco */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Headings, nav, buttons, UI chrome → Lucida Grande */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
.navbar, .navbar-brand, .nav-link, .nav-item,
.btn, .btn-book, .btn-earth, .btn-earth-ghost,
.hero-name, .hero-role, .hero-eyebrow, .section-title, .interest-tags span,
.post-title, .post-card-title,
.jumbotron h3, .jumbotron h4, .jumbotron h5,
.sr-title {
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
}

/* ===========================================================================
   Minimal polish — elegant, quiet. No hover lifts, minimal transitions.
   =========================================================================== */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden; /* kill stray horizontal overflow that off-centers the column */
}

.container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Links — green at rest, terracotta on hover (instant, no animation) */
a {
  color: #4ec9d4;
  text-decoration: none;
}

a:hover {
  color: #3ab0d1;
}

/* Navbar — quiet, flat, hairline border; everything vertically centered */
.navbar {
  margin-bottom: 2rem;
  padding: 0.75rem 1.25rem;
  background: #222 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
  margin-right: 1.5rem;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand img.brand-logo {
  vertical-align: middle;
  margin-top: 0 !important;
  width: 44px;
  height: 44px;
  opacity: 1;
}

.navbar .navbar-nav {
  align-items: center;
}

.navbar .nav-link {
  display: flex;
  align-items: center;
  color: #e5e5ea !important;
  opacity: 0.78;
  padding: 0.5rem 0.75rem!important;
}

.navbar .nav-link:hover {
  opacity: 1;
  color: #fff !important;
}

/* Raw, flat layout — no cards, no boxes */
.jumbotron {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 2rem;
}

.jumbotron h3, .jumbotron .h3 {
  margin-top: 0;
}

/* About — profile header (photo + name inline, raw) */
.profile-head {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0.5rem 0 2.5rem;
}

.profile-meta {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.profile-role {
  font-size: 1rem;
  color: #8e8e93;
  font-style: normal;
  margin: 0 0 1rem;
}

/* Readable prose — comfortable measure & rhythm */
.prose {
  max-width: 100%;
}

.prose p {
  font-size: 1rem;
  line-height: 1.75;
  color: #d8cfbf;
  margin: 0 0 1.3em;
}

.prose .about-lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #ece4d6;
  margin: 0 0 1.1em;
}

.prose h3, .prose .h3 {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8e8e93;
  margin: 2.2em 0 0.8em;
  font-weight: 700;
}

.prose a {
  color: #4ec9d4;
}

.prose a:hover {
  color: #5dd4e8;
}

.about-work {
  padding-left: 1.1em;
}

.about-work li {
  line-height: 1.7;
  margin-bottom: 0.6em;
}

.about-work strong {
  color: #e5e5ea;
}

@media (max-width: 640px) {
  .profile-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}
h1, .h1, h2, .h2, h3, .h3 {
  letter-spacing: -0.01em;
}

.post-title {
  font-size: 2rem;
}

.section-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8e8e93;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

/* Home hero — simple type hierarchy */
.hero {
  padding: 0.25rem 0 0.5rem;
}

.hero-eyebrow {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8e8e93;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.hero-name {
  font-size: 2rem;
  line-height: 1.08;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-aka {
  font-size: 0.9375rem;
  color: #8e8e93;
  margin: 0 0 1rem;
  font-style: italic;
}

.hero-aka strong {
  color: #e5e5ea;
  font-weight: 600;
  font-style: normal;
}

.hero-role {
  font-size: 1rem;
  color: #e5e5ea;
  margin: 0 0 1.25rem;
}

/* Screen-reader-only: visually hidden, still indexed by Google + read by AT. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #e2dbcd;
  margin: 0 0 1rem;
  max-width: 36em;
}

.hero-body {
  font-size: 1rem;
  line-height: 1.62;
  color: #c8bfb0;
  margin: 0 0 0.5rem;
  max-width: 38em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Prominent circular profile photo */
.profile-pic {
  width: 168px;
  height: 168px;
  border-radius: 50% !important;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}

.profile-pic-lg {
  width: 200px;
  height: 200px;
}

.profile-pic-home {
  width: 230px;
  height: 230px;
  margin-bottom: 1.25rem;
}

@media (max-width: 767px) {
  .profile-pic-home {
    width: 190px;
    height: 190px;
  }
}
/* "Trusted by"-style experience strip — quiet, single ghosted line */
.logos-band {
  margin: 0.5rem 0 1.75rem;
}

.logos-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8e8e93;
  opacity: 0.9;
  margin: 0 0 1rem;
}

.logo-strip {
  display: flex;
  flex-wrap: nowrap; /* always a single row */
  align-items: center;
  gap: 26px;
}

.logo-strip a { /* equal slots so 5 logos always fit one line */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-strip img {
  max-width: 100%;
  max-height: 50px;
  width: auto;
  height: auto;
  display: block;
  opacity: 0.55; /* ghosted but legible */
  filter: saturate(0);
}

.logo-strip a:hover img {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .logo-strip {
    gap: 16px;
  }
  .logo-strip img {
    max-height: 38px;
  }
}
.home-block {
  margin-top: 2.25rem;
}

.home-note {
  color: #cfc7b8;
  max-width: 42em;
}

/* Home — visitor world map (jsVectorMap), palette-styled */
.home-visitors {
  clear: both;
  width: 100%;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid #3a3a3c;
}

.visitor-map {
  text-align: center;
}

.visitor-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #8e8e93;
  opacity: 0.9;
  margin: 0 0 0.25rem;
}

.visitor-total {
  font-size: 0.875rem;
  color: #e5e5ea;
  opacity: 0.75;
  margin: 0 0 1rem;
}

.visitor-frame {
  background: #2c2c2e;
  border: 1px solid #3a3a3c;
  border-radius: 14px;
  padding: 1rem;
}

#worldmap {
  width: 100%;
  height: 420px;
}

.visitor-placeholder {
  color: #8e8e93;
  font-size: 0.875rem;
  padding: 1.75rem 1.5rem;
}

.visitor-placeholder code {
  color: #e5e5ea;
  background: rgba(255, 255, 255, 0.05);
  padding: 0 0.25rem;
  border-radius: 4px;
}

/* jsVectorMap tooltip in our palette */
.jvm-tooltip {
  background: #1c1c1e !important;
  border: 1px solid #3a3a3c !important;
  color: #e5e5ea !important;
  font-size: 0.875rem;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

@media (max-width: 600px) {
  #worldmap {
    height: 300px;
  }
}
/* Interest pills — static */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-tags span {
  display: inline-block;
  font-size: 0.875rem;
  color: #e5e5ea;
  border: 1px solid #3a3a3c;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

/* Buttons — primary (filled) + ghost (outline), no motion */
.btn-earth, .btn-earth-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-earth {
  background: #3ab0d1;
  color: #fff !important;
  border: 1px solid #14505c;
}

.btn-earth:hover {
  background: #14505c;
  color: #fff !important;
  text-decoration: none;
}

.btn-earth-ghost {
  background: transparent;
  color: #e5e5ea !important;
  border: 1px solid #3a3a3c;
}

.btn-earth-ghost:hover {
  border-color: #3ab0d1;
  color: #5dd4e8 !important;
  text-decoration: none;
}

/* News list inside sidebar card */
#newsid .jumbotron h4, #newsid .jumbotron .h4 {
  margin-bottom: 1rem;
}

#newsid .jumbotron b {
  color: #5dd4e8;
  font-size: 0.875rem;
}

#newsid .jumbotron p {
  margin: 0.25rem 0 1rem;
  color: #cfc7b8;
}

#newsid .jumbotron h5 a, #newsid .jumbotron .h5 a {
  color: #4ec9d4;
  font-size: 0.9375rem;
}

/* Footer — calm */
.container-footer {
  max-width: 840px;
  padding-top: 0.5rem;
}

footer, .container-footer {
  color: #8e8e93;
}

.container-footer h4, .container-footer .h4, .container-footer h3, .container-footer .h3, .container-footer h5, .container-footer .h5 {
  color: #e5e5ea;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-footer a {
  color: #4ec9d4;
  transition: color 0.15s ease;
}

.panel-footer a:hover {
  color: #3ab0d1;
  text-decoration: none;
}

.panel-footer a i.ph {
  font-size: 1rem;
  margin-right: 0.25rem;
  vertical-align: -2px;
  display: inline-block;
}

@media (max-width: 767px) {
  .hero-name {
    font-size: 2rem;
  }
  #newsid {
    margin-top: 0.5rem;
  }
}
/* Jupyter notebook embed */
.jupyter-notebook {
  margin: 1.5rem 0;
  border: 1px solid #3a3a3c;
  border-radius: 8px;
  background: #1c1c1e;
  font-size: 0.9375rem;
  overflow: hidden;
}

.jupyter-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
  background: #242426;
  border-bottom: 1px solid #3a3a3c;
}

.jupyter-download {
  color: #8e8e93 !important;
  font-size: 0.875rem;
  text-decoration: none;
}

.jupyter-download:hover {
  color: #5dd4e8 !important;
}

.jupyter-cell {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(58, 53, 46, 0.6);
}

.jupyter-cell:last-child {
  border-bottom: 0;
}

.jupyter-markdown {
  color: #e5e5ea;
}

.jupyter-markdown p {
  margin-bottom: 0.5rem;
}

.jupyter-markdown h1, .jupyter-markdown .h1, .jupyter-markdown h2, .jupyter-markdown .h2, .jupyter-markdown h3, .jupyter-markdown .h3,
.jupyter-markdown h4,
.jupyter-markdown .h4, .jupyter-markdown h5, .jupyter-markdown .h5 {
  color: #e5e5ea;
  margin-top: 0.8rem;
}

.jupyter-code {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 6px 10px;
  align-items: start;
}

.jupyter-noprompt {
  grid-template-columns: 1fr;
}

.jupyter-noprompt .jupyter-output-block {
  grid-column: 1/2;
}

.jupyter-prompt {
  color: #3ab0d1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  padding-top: 0.5rem;
  text-align: right;
  user-select: none;
}

.jupyter-prompt-out {
  color: #4ec9d4;
}

.jupyter-input pre.highlight,
.jupyter-input code {
  margin: 0;
  background: #141416;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  color: #e5e5ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  line-height: 1.45;
}

.jupyter-input pre.highlight code {
  padding: 0;
  background: transparent;
  border: 0;
}

.jupyter-output-block {
  grid-column: 2/3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.25rem;
}

.jupyter-output {
  margin: 0;
  color: #e5e5ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  background: #121214;
  border-left: 3px solid #4ec9d4;
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.jupyter-stderr,
.jupyter-error-output {
  border-left-color: #3ab0d1;
  color: #e0bda8;
}

.jupyter-image {
  background: transparent;
  border-left: 0;
  padding: 0.5rem 0;
}

.jupyter-image img,
.jupyter-image svg {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.jupyter-html {
  background: transparent;
  border-left: 0;
  padding: 0.25rem 0;
  color: #e5e5ea;
}

.jupyter-html table {
  color: #e5e5ea;
}

.jupyter-html table th, .jupyter-html table td {
  border-color: #3a3a3c;
  padding: 0.25rem 0.5rem;
}

.jupyter-latex {
  background: transparent;
  border-left: 0;
  padding: 0.25rem 0;
}

.jupyter-raw pre {
  background: #141416;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: #8e8e93;
  font-size: 0.875rem;
}

.jupyter-error {
  color: #e0bda8;
  padding: 1rem;
}

@media (max-width: 600px) {
  .jupyter-code {
    grid-template-columns: 1fr;
  }
  .jupyter-prompt {
    text-align: left;
    padding-top: 0;
  }
  .jupyter-output-block {
    grid-column: 1/2;
  }
}
/* ===========================================================================
   LaTeX compilation cell — research-grade TeX rendered in place
   =========================================================================== */
/* Computer Modern / Latin Modern — the classic LaTeX look, self-hosted */
@font-face {
  font-family: "Latin Modern";
  src: url("https://shivaram.net/assets/fonts/LM-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("https://shivaram.net/assets/fonts/LM-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("https://shivaram.net/assets/fonts/LM-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("https://shivaram.net/assets/fonts/LM-bold-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
.tex-paper {
  margin: 1.5rem 0;
  border: 1px solid #3a3a3c;
  border-radius: 8px;
  background: #1c1c1e;
  font-size: 0.9375rem;
  overflow: hidden;
}

.tex-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.75rem;
  background: #242426;
  border-bottom: 1px solid #3a3a3c;
}

.tex-label {
  color: #e5e5ea;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tex-label i {
  color: #3ab0d1;
  margin-right: 0.5rem;
}

.tex-meta {
  flex: 1;
  color: #8e8e93;
  font-size: 0.75rem;
  text-align: right;
}

.tex-download {
  color: #8e8e93 !important;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}

.tex-download:hover {
  color: #5dd4e8 !important;
}

.tex-pdf-warn {
  color: #3ab0d1;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: help;
}

.tex-html {
  padding: 1.5rem 1.75rem 1.75rem;
  color: #e5e5ea;
  font-family: "Latin Modern", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.62;
  overflow-wrap: break-word;
}

.tex-html .tex-titleblock {
  text-align: center;
  margin: 0.5rem 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(58, 53, 46, 0.5);
}

.tex-html .tex-titleblock .title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.25;
  color: #e5e5ea;
  border: 0;
}

.tex-html .tex-titleblock .author,
.tex-html .tex-titleblock .date {
  margin: 0.25rem 0;
  color: #8e8e93;
  font-size: 0.9375rem;
}

.tex-html .tex-abstract {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(58, 53, 46, 0.6);
  border-left: 3px solid #3ab0d1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9375rem;
}

.tex-html .tex-abstract h1, .tex-html .tex-abstract .h1 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5dd4e8;
  margin: 0 0 0.5rem;
  border: 0;
}

.tex-html h1, .tex-html .h1,
.tex-html h2,
.tex-html .h2,
.tex-html h3,
.tex-html .h3,
.tex-html h4,
.tex-html .h4 {
  color: #e5e5ea;
  margin: 1.5em 0 0.5em;
  line-height: 1.3;
}

.tex-html h1, .tex-html .h1 {
  font-size: 1.125rem;
  border-bottom: 1px solid rgba(58, 53, 46, 0.4);
  padding-bottom: 0.25rem;
}

.tex-html h2, .tex-html .h2 {
  font-size: 1.125rem;
}

.tex-html h3, .tex-html .h3 {
  font-size: 1rem;
}

.tex-html h1.unnumbered, .tex-html .unnumbered.h1 {
  border-bottom: 0;
}

.tex-html p {
  margin: 0.55em 0;
}

.tex-html a {
  color: #5dd4e8;
}

.tex-html a:hover {
  color: #3ab0d1;
}

.tex-html .tex-eqref {
  color: #5dd4e8;
  text-decoration: none;
}

.tex-html .tex-tikz {
  margin: 1.2em auto;
  text-align: center;
}

.tex-html .tex-tikz img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.tex-html table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.tex-html table th,
.tex-html table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(58, 53, 46, 0.7);
}

.tex-html table th {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e5ea;
}

.tex-html table caption {
  caption-side: bottom;
  color: #8e8e93;
  font-size: 0.875rem;
  padding-top: 0.5rem;
}

.tex-html .math {
  color: #e5e5ea;
}

.tex-html .math.display {
  display: block;
  margin: 0.9em 0;
  overflow: visible;
}

.tex-html .math.display mjx-container[display=true] svg {
  max-width: 100%;
  height: auto;
}

.tex-html .tex-references {
  margin-top: 1.5rem;
  padding-top: 0.25rem;
  font-size: 0.875rem;
}

.tex-html .tex-references h1, .tex-html .tex-references .h1 {
  font-size: 1rem;
  border-bottom: 1px solid rgba(58, 53, 46, 0.4);
}

.tex-html .tex-references p {
  margin: 0.4em 0 0.4em 0;
  padding-left: 2.4em;
  text-indent: -2.4em;
}

.tex-html .tex-bibnum {
  color: #5dd4e8;
  margin-right: 0.5rem;
}

.tex-html blockquote {
  margin: 1em 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid #3a3a3c;
  color: #8e8e93;
}

.tex-html code {
  background: #141416;
  border: 1px solid #3a3a3c;
  border-radius: 4px;
  padding: 0 0.25rem;
  font-size: 0.875rem;
}

.tex-source {
  border-top: 1px solid #3a3a3c;
  background: #141416;
}

.tex-source summary {
  cursor: pointer;
  color: #8e8e93;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  user-select: none;
}

.tex-source summary:hover {
  color: #5dd4e8;
}

.tex-source summary i {
  margin-right: 0.5rem;
}

.tex-source pre.highlight,
.tex-source code {
  margin: 0;
  padding: 0.25rem 0.75rem 0.75rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #e5e5ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

.tex-error {
  padding-bottom: 0.75rem;
}

.tex-error-body {
  color: #e0bda8;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.tex-error-body code {
  color: #5dd4e8;
}

.tex-error-log summary {
  color: #3ab0d1;
}

.tex-error-log pre,
.tex-error-log code {
  background: transparent;
  border: 0;
  padding: 0 1rem 0.75rem;
  color: #b0a690;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 600px) {
  .tex-meta {
    display: none;
  }
  .tex-html {
    padding: 1rem 1rem 1.25rem;
  }
}
/* ===========================================================================
   Projects page — Apple-like minimal media cards
   =========================================================================== */
.projects-intro {
  color: #8e8e93;
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 0.25rem 0 2.25rem;
  max-width: 55ch;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 700px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
.project-card {
  display: flex;
  flex-direction: column;
  background: #1c1c1e;
  border: 1px solid rgba(143, 158, 106, 0.25);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: #3ab0d1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.project-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #121214;
  overflow: hidden;
}

.project-media p {
  margin: 0;
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.project-body {
  padding: 1.25rem 1.25rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

.project-text {
  min-width: 0;
}

.project-title {
  margin: 0 0 0.25rem;
  font-family: "EB Garamond", "Apple Garamond", "ITC Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: #e5e5ea;
}

.project-title a {
  color: #e5e5ea;
  text-decoration: none;
}

.project-title a:hover {
  color: #5dd4e8;
}

.project-subtitle {
  margin: 0 0 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #4ec9d4;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.project-description {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #e5e5ea;
  opacity: 0.82;
}

.project-github {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 0;
  color: #4ec9d4 !important;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.project-github:hover {
  color: #3ab0d1 !important;
  background: rgba(255, 255, 255, 0.06);
  transform: scale(1.08);
}

/* ===========================================================================
   Scrollspy TOC — quiet text rail on desktop, collapsible on mobile.
   Pattern: Docusaurus / Stripe docs side TOC.
   =========================================================================== */
/* offset anchored headings so the sticky navbar doesn't cover them */
.post-content :is(h2, .h2, h3, .h3),
.note-content :is(h2, .h2, h3, .h3) {
  scroll-margin-top: 5.25rem;
}

/* --- shared list styling (used by both rail + mobile) --- */
.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.post-toc-item {
  position: relative;
  margin: 0;
  padding: 0;
}

.post-toc-item.is-sub {
  padding-left: 0.75rem;
}

.post-toc-link {
  display: block;
  padding: 0.25rem 0.75rem 0.25rem 1rem;
  margin: 0 0 0 -1px; /* overlap the track border */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #8e8e93;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-toc-item.is-sub .post-toc-link {
  font-size: 0.75rem;
  padding-left: 1rem;
}

.post-toc-link:hover {
  color: #e5e5ea;
  background: rgba(255, 255, 255, 0.04);
  border-left-color: rgba(143, 158, 106, 0.5);
}

.post-toc-link.active {
  color: #5dd4e8;
  font-weight: 600;
  border-left-color: #3ab0d1;
  background: linear-gradient(to right, rgba(189, 93, 52, 0.12), transparent 60%);
}

.post-toc-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #3ab0d1;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(189, 93, 52, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .post-toc-link {
    transition: none;
  }
}
/* --- desktop rail (fixed, right margin) --- */
.post-toc {
  position: fixed;
  right: calc(50% - 420px - 188px); /* line up just outside the 840px reading column */
  top: 132px; /* below the sticky navbar */
  width: 200px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  z-index: 500;
  display: none; /* default hidden; CSS owns visibility below */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.post-toc::-webkit-scrollbar {
  width: 6px;
}

.post-toc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* scene shifts own visibility purely via media queries + .is-ready */
@media (min-width: 1024px) {
  .post-toc.is-ready {
    display: block;
  }
}
@media (max-width: 1340px) and (min-width: 1024px) {
  .post-toc.is-ready {
    right: 24px;
    width: 180px;
  }
}
.post-toc-heading {
  margin: 0 0 0.75rem;
  padding-left: 1rem;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8e8e93;
}

/* --- mobile: floating action button + slide-up sheet (<dialog>) --- */
.toc-fab {
  display: none; /* CSS owns visibility */
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #3a3a3c;
  background: #1e1e20;
  color: #e5e5ea !important;
  font-size: 1.125rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

@media (max-width: 1023px) {
  .toc-fab.is-ready {
    display: flex;
  }
}
.toc-fab:hover {
  transform: translateY(-2px);
  border-color: #3ab0d1;
  color: #5dd4e8 !important;
}

/* <dialog> — JS uses showModal()/close(); [open] is the only state.
   On desktop, force-hide so a stray [open] never leaks the mobile sheet. */
.toc-sheet {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100vw;
  max-width: none;
  max-height: none;
}

.toc-sheet[open] {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 1024px) {
  .toc-sheet {
    display: none !important;
  } /* desktop never shows the sheet */
}
.toc-sheet::backdrop {
  background: rgba(10, 9, 7, 0.75);
  backdrop-filter: blur(2px);
}

.toc-sheet-card {
  width: 100%;
  max-width: 520px;
  background: #1e1e20;
  border: 1px solid #3a3a3c;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  padding: 0.5rem 1rem 1rem;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  max-height: 70vh;
  overflow-y: auto;
  animation: tocSheetUp 0.22s ease;
}

@keyframes tocSheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.toc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #3a3a3c;
}

.toc-sheet-close {
  background: transparent;
  border: 0;
  color: #8e8e93;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toc-sheet-close:hover {
  color: #5dd4e8;
  background: rgba(255, 255, 255, 0.06);
}

.post-toc-heading--sheet {
  margin: 0;
  padding-left: 0;
}

.toc-sheet-list {
  border-left: 0 !important;
  padding-top: 0.25rem;
}

.toc-sheet-list .post-toc-link {
  border-left: 0;
  margin-left: 0;
  padding-left: 0;
  padding: 0.5rem 0.5rem;
  white-space: normal;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.toc-sheet-list .post-toc-item.is-sub {
  padding-left: 1rem;
}

.toc-sheet-list .post-toc-item.is-sub2 {
  padding-left: 1.75rem;
}

.toc-sheet-list .post-toc-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #5dd4e8;
}

.toc-sheet-list .post-toc-link.active {
  background: linear-gradient(to right, rgba(189, 93, 52, 0.14), transparent 70%);
  border-left: 0;
}

.toc-sheet-list .post-toc-item.is-active::before {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .toc-sheet-card {
    animation: none;
  }
  .toc-fab {
    transition: none;
  }
}
/* H1 ("top") TOC items: bold, full-size — for "Note:" style intros */
.post-toc-item.is-top > .post-toc-link {
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: #e5e5ea;
  letter-spacing: 0.01em;
}

.post-toc-item.is-top > .post-toc-link.active {
  color: #3ab0d1;
}

/* H4 — smallest indent, muted */
.post-toc-item.is-sub2 > .post-toc-link {
  font-size: 0.75rem;
  opacity: 0.8;
  padding-left: 1.25rem;
}

/* Reading progress bar — thin top thread, only visible mid-scroll */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #4ec9d4, #3ab0d1);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.05s linear;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(189, 93, 52, 0.5);
  will-change: transform;
}

/* graceful-disable when < 3 sections — CSS only, no inline style fights */
.post-toc[data-hidden],
.toc-fab[data-hidden] {
  display: none !important;
}
