/* ── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&display=swap');

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --navy:    #0f172a;
  --navy-2:  #1e293b;
  --teal:    #0d9488;
  --teal-lt: #ccfbf1;
  --ink:     #1e293b;
  --muted:   #475569;
  --slate:   #64748b;
  --border:  #e2e8f0;
  --bg-card: #f8fafc;
  --white:   #ffffff;
  --radius:  12px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 6px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.1);
  
}


/* ── Base ──────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--navy);
  line-height: 1.25;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  background-color: var(--navy) !important;
  border-bottom: none;
  padding: 0.65rem 2rem;
}

.navbar-brand {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #f1f5f9 !important;
  letter-spacing: -0.01em;
}

.navbar-nav .nav-link {
  color: #94a3b8 !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem !important;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.navbar-nav .nav-link:hover {
  color: #f1f5f9 !important;
  background: rgba(255,255,255,0.08);
}

/* ── Full-bleed hero (home page only) ──────────────────── */
/* index.qmd uses page-layout: full; this makes the content
   span edge-to-edge so .hero and .info-section fill the viewport */
.page-layout-full .content.column-page {
  grid-column: 1 / -1 !important;
  padding: 0 !important;
  max-width: none !important;
}

/* Hide the empty title block Quarto injects */
#title-block-header { display: none; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #f0fdfa 0%, #f8fafc 60%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4.5rem;
  box-sizing: border-box;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text { flex: 1; }

.hero-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.65rem;
}

.hero-name {
  font-family: 'Source Serif 4', serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem 0;
  line-height: 1.1;
}

.hero-bio {
  font-size: 0.97rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  max-width: 520px;
}

.hero-bio strong { color: var(--ink); font-weight: 600; }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.btn-pill {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink) !important;
  background: var(--white);
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-pill:hover {
  border-color: var(--teal);
  color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}

.btn-pill.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white) !important;
}

.btn-pill.btn-primary:hover {
  background: #0f766e;
  border-color: #0f766e;
  color: var(--white) !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,.2);
}

/* ── Photo circle ──────────────────────────────────────── */
.hero-photo { flex-shrink: 0; }

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes ring-glow {
  0%, 100% { filter: blur(6px) brightness(1.1); opacity: 0.75; }
  50%       { filter: blur(10px) brightness(1.4); opacity: 1; }
}

.photo-ring {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 4px;
  background: transparent;
  isolation: isolate;
}

.photo-ring::before,
.photo-ring::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--teal), #6366f1, #a78bfa, var(--teal));
  animation: ring-spin 4s linear infinite;
}

.photo-ring::before { z-index: -1; }

.photo-ring::after {
  z-index: -2;
  inset: -8px;
  filter: blur(8px) brightness(1.2);
  opacity: 0.85;
  animation: ring-spin 4s linear infinite, ring-glow 3s ease-in-out infinite;
}

.photo-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 1;
  /* white gap between ring and photo */
  outline: 4px solid white;
}

/* ── Project cards (research & portfolio pages) ────────── */
.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover {
  box-shadow: 0 6px 20px rgba(32,178,152,0.15);
  transform: translateY(-2px);
}
.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.project-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Info cards (home page below hero) ─────────────────── */
.info-section {
  padding: 3rem 2rem 3.5rem;
  box-sizing: border-box;
}

.info-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.info-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.25rem;
}

.card-body { font-size: 0.875rem; }

.edu-entry {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.edu-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.edu-degree { font-weight: 600; color: var(--ink); margin-bottom: 0.1rem; }
.edu-place  { color: var(--muted); font-size: 0.83rem; }
.edu-note   { color: var(--slate); font-size: 0.8rem; margin-top: 0.15rem; }

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(32, 178, 152, 0.5); opacity: 1; }
  50%       { box-shadow: 0 0 6px 4px rgba(32, 178, 152, 0); opacity: 0.75; }
}

.badge-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--teal-lt);
  color: var(--teal);
  padding: 0.1em 0.55em;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: 0.3rem;
  text-transform: uppercase;
  animation: badge-pulse 2.4s ease-in-out infinite;
}

.award-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.award-entry:last-child { margin-bottom: 0; }

.award-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  margin-top: 0.45rem;
}

/* ── Research & CV pages ───────────────────────────────── */
#quarto-document-content > p:first-of-type {
  font-size: 1rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

#quarto-document-content h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal);
  display: inline-block;
}

#quarto-document-content h3 {
  font-size: 1.05rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

#quarto-document-content h4 {
  font-size: 0.92rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
}

#quarto-document-content h5 {
  font-size: 0.82rem;
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
}

/* ── Publication entries ───────────────────────────────── */
.pub-entry {
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  transition: border-left-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pub-entry:hover {
  border-left-color: var(--teal);
  background: #f0fdfa;
  box-shadow: var(--shadow);
}

.pub-entry strong { color: var(--ink); }
.pub-entry em { color: var(--navy); font-style: italic; }

.pub-entry a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  padding: 0.1em 0.45em;
  background: var(--teal-lt);
  border-radius: 4px;
  text-decoration: none;
  margin-left: 0.25rem;
}
.pub-entry a:hover { background: var(--teal); color: white; }

/* ── Teaching table ────────────────────────────────────── */
table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

thead th {
  background: var(--navy);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
}

tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #f0fdfa; }

tbody td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
tbody tr:last-child td { border-bottom: none; }

/* ── CV page ───────────────────────────────────────────── */
.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 0 1.5rem;
  border-bottom: 2px solid var(--teal);
  margin-bottom: 0.5rem;
}

.cv-name {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.cv-location {
  color: var(--slate);
  font-size: 0.9rem;
  margin: 0;
}

.cv-contact-block {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.9;
}
.cv-contact-block a { color: var(--teal); }

/* Mentee tags */
.mentee-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}
.mentee-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--teal);
  background: var(--teal-lt);
  border: 1px solid rgba(32,178,152,0.25);
  padding: 0.25em 0.75em;
  border-radius: 99px;
}

/* CV timeline entries */
.cv-section { margin-bottom: 0.5rem; }

.cv-entry {
  display: grid;
  grid-template-columns: 110px 1fr 130px;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.cv-entry:last-child { border-bottom: none; }

.cv-entry-logo-col {
  display: flex;
  align-items: center;
  padding-top: 0.1rem;
  min-height: 1rem;
}

.cv-entry-logo-col a {
  display: block;
  line-height: 0;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
}

.cv-entry-logo-col a:hover .cv-entry-logo {
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cv-entry-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
  padding-top: 0.1rem;
  white-space: nowrap;
}

.cv-entry-body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.cv-entry-body strong { color: var(--ink); }
.cv-entry-body em { color: var(--slate); font-style: italic; }

.cv-entry-body ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
.cv-entry-body li { margin-bottom: 0.2rem; }

/* Teaching quotes */
.teaching-quotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
}
.teaching-quote {
  background: var(--teal-lt);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
}
.teaching-quote::before {
  content: "\201C";
  font-size: 1.6rem;
  color: var(--teal);
  line-height: 0;
  vertical-align: -0.5rem;
  margin-right: 0.15rem;
  font-style: normal;
}
.teaching-quote-source {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-style: normal;
  color: var(--slate);
}
@media (max-width: 600px) {
  .teaching-quotes { grid-template-columns: 1fr; }
}

.cv-entry-logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

/* ── Skills grid ───────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

.skill-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.skill-block strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}

/* ── Misc ──────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 720px) {
  .hero { padding: 3rem 1.25rem; }
  .hero-inner { flex-direction: column-reverse; gap: 2rem; text-align: center; }
  .hero-name { font-size: 2.1rem; }
  .hero-bio { max-width: 100%; }
  .hero-links { justify-content: center; }
  .photo-ring { width: 155px; height: 155px; }
  .info-inner { grid-template-columns: 1fr; }
  .info-section { padding: 2rem 1.25rem; }
  .cv-header { flex-direction: column; gap: 0.75rem; }
  .cv-contact-block { text-align: left; }
  .cv-entry { grid-template-columns: 1fr; gap: 0.25rem; }
  .cv-entry-logo-col { display: none; }
  .skills-grid { grid-template-columns: 1fr; }
}



/* ── Table of Contents (TOC) ───────────────────────────── */
#TOC {
  font-size: 0.875rem;
}

/* The TOC title */
.toc-title {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1rem;
}

/* Standard TOC links */
#TOC a {
  color: var(--muted);
  text-decoration: none;
  padding-left: 0.5rem;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-left-color 0.15s ease;
}

/* ── TOC links on hover ────────────────────────────────── */
#TOC a:hover,
div.sidebar-item-container a:hover {
  color: var(--teal) !important;
  background-color: var(--teal-lt); 
  border-left-color: var(--teal);
  border-radius: 0 6px 6px 0; /* Keeps the edges softly rounded */
  transition: all 0.15s ease; /* Makes the color change smooth */
}

/* The active TOC link (current section) */
#TOC a.active,
#TOC .nav-link.active {
  color: var(--teal);
  font-weight: 600;
  border-left-color: var(--teal);
}

/* Indent nested TOC levels nicely */
#TOC ul ul {
  padding-left: 1rem;
  margin-top: 0.25rem;
}

/* ── The active/selected TOC link ──────────────────────── */
#TOC a.active,
#TOC .nav-link.active,
div.sidebar-item-container .active {
  color: var(--teal) !important;
  font-weight: 600;
  border-left-color: var(--teal) !important;
  
  /* Optional: Adds a very light teal background to the selected item */
  background-color: var(--teal-lt); 
  border-radius: 0 6px 6px 0;
}

