:root {
  --nl-title: #6e7c87;
  --nl-mid: #95a0a6;
  --nl-soft: #c4cacd;
  --nl-bg: #e4e7e8;
  --nl-text: #2f363b;
  --nl-surface: rgba(255, 255, 255, 0.56);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) {
  background-color: var(--nl-bg);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) {
  color: var(--nl-text);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .page-columns,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) main,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) #quarto-content,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .content {
  background-color: var(--nl-bg);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) h1,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) h2,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) h3,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) h4,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .title,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar-title {
  color: var(--nl-title);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) a {
  color: #53626d;
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) a:hover,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) a:focus {
  color: var(--nl-title);
}

/* =========================================================
   NAVBAR: kill Darkly blue + keep same height in both modes
   ========================================================= */

/* Same height/padding always */
.navbar {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
  box-shadow: none !important;
  background-image: none !important;
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar {
  background-color: var(--nl-bg) !important;
  border-bottom: 1px solid var(--nl-soft);
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .nav-link,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .navbar-brand,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar a {
  color: var(--nl-title) !important;
}

html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .nav-link:hover,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .nav-link:focus,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .navbar-brand:hover,
html:not([data-bs-theme="dark"]) body:not(.quarto-dark) .navbar .navbar-brand:focus {
  color: #53626d !important;
}

/* --- DARK MODE detection (covers Quarto + Bootstrap variants) --- */
html[data-bs-theme="dark"] .navbar,
body.quarto-dark .navbar,
html.quarto-dark .navbar,
body[data-bs-theme="dark"] .navbar {
  background-color: #1e1e1e !important; /* neutral dark */
  background-image: none !important;
}

/* If Darkly applies bg-primary to navbar, override that too */
html[data-bs-theme="dark"] .navbar.bg-primary,
body.quarto-dark .navbar.bg-primary,
html.quarto-dark .navbar.bg-primary,
body[data-bs-theme="dark"] .navbar.bg-primary {
  background-color: #1e1e1e !important;
}

/* Make text/icons readable in dark mode */
html[data-bs-theme="dark"] .navbar .nav-link,
html[data-bs-theme="dark"] .navbar .navbar-brand,
html[data-bs-theme="dark"] .navbar a,
body.quarto-dark .navbar .nav-link,
body.quarto-dark .navbar .navbar-brand,
body.quarto-dark .navbar a {
  color: #ffffff !important;
}

/* Mobile hamburger visibility in dark mode */
html[data-bs-theme="dark"] .navbar .navbar-toggler,
body.quarto-dark .navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.35) !important;
}
html[data-bs-theme="dark"] .navbar .navbar-toggler-icon,
body.quarto-dark .navbar .navbar-toggler-icon {
  filter: invert(1) !important;
}

#hero-heading p {
  line-height: 1.65;
}

.academic-block {
  background-color: #f8f9fa;
  border-left: 4px solid #2c3e50;
  padding: 15px 20px;
  margin-bottom: 25px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #333333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.academic-block:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(3px);
}

.hero-summary {
  max-width: min(100%, 42rem);
  margin: 0.35rem 0 1rem;
  text-align: left;
}

.hero-summary p {
  margin: 0 0 0.65rem;
}

.hero-summary p:last-child {
  margin-bottom: 0;
}

.academic-accent {
  color: #2c3e50;
  background-color: #e9ecef;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95em;
}

.dynamic-link {
  display: inline-block;
  color: #2c3e50;
  text-decoration: none;
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin-right: 25px;
  margin-top: 15px;
  padding-bottom: 4px;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
}

.dynamic-link::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #2c3e50;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
}

.dynamic-link:hover,
.dynamic-link:focus {
  color: #2c3e50;
  text-decoration: none;
}

.dynamic-link:hover::after,
.dynamic-link:focus::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

#hero-heading .about-links {
  margin-left: 0;
}

html[data-bs-theme="dark"] .academic-block,
body.quarto-dark .academic-block {
  background-color: rgba(255, 255, 255, 0.06);
  border-left-color: #2dd4bf;
  color: #e5e7eb;
}

html[data-bs-theme="dark"] .academic-accent,
body.quarto-dark .academic-accent {
  color: #dffcf8;
  background-color: rgba(45, 212, 191, 0.16);
}

html[data-bs-theme="dark"] .dynamic-link,
html[data-bs-theme="dark"] .dynamic-link:hover,
html[data-bs-theme="dark"] .dynamic-link:focus,
body.quarto-dark .dynamic-link,
body.quarto-dark .dynamic-link:hover,
body.quarto-dark .dynamic-link:focus {
  color: #dffcf8;
}

html[data-bs-theme="dark"] .dynamic-link::after,
body.quarto-dark .dynamic-link::after {
  background-color: #2dd4bf;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.project-card {
  border: 1px solid var(--nl-soft);
  border-radius: 8px;
  padding: 1rem;
  background: var(--nl-surface);
}

.project-card h3 {
  margin-top: 0;
  font-size: 1.08rem;
  color: var(--nl-title);
}

.project-card p {
  margin-bottom: 0.85rem;
}

html[data-bs-theme="dark"] .project-card,
body.quarto-dark .project-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
