:root {
  color-scheme: light;
  --accent-color: #116e8a;
  --accent-hover: #0e5268;
  --accent-soft: rgba(17, 110, 138, 0.1);
  --accent-soft-strong: rgba(17, 110, 138, 0.18);
  --button-bg: #116e8a;
  --button-hover: #0e5268;
  --button-text: #ffffff;
  --highlight-color: #d8a928;
  --background-color: #f7faf8;
  --background-gradient: linear-gradient(180deg, rgba(17, 110, 138, 0.075) 0%, rgba(63, 122, 77, 0.05) 9rem, rgba(247, 250, 248, 0) 22rem);
  --surface-1: #ffffff;
  --surface-2: #f1f6f3;
  --surface-3: #e5eee9;
  --text-color: #16251f;
  --text-muted: #46594f;
  --text-subtle: #63746a;
  --border-color: #d7e4dd;
  --shadow-sm: 0 2px 6px rgba(17, 47, 38, 0.08);
  --shadow-md: 0 8px 16px rgba(17, 47, 38, 0.12);
  --shadow-lg: 0 16px 28px rgba(17, 47, 38, 0.16);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --page-max-width: 980px;
  --content-max-width: 760px;
  --font-size-body: 1rem;
  --font-size-h1: 2.55rem;
  --font-size-h2: 1.85rem;
  --font-size-h3: 1.35rem;
  --space-section: clamp(1.5rem, 2vw, 2.5rem);
  --note-bg: #fff7dc;
  --note-text: #5f4808;
  --note-border: #d8a928;
  --info-bg: rgba(17, 110, 138, 0.09);
  --info-border: rgba(17, 110, 138, 0.25);
  --info-text: #263d3a;
  --info-warning: #7a5209;
  --code-bg: #edf5f1;
  --code-text: #8a2d3b;
  --blockquote-bg: rgba(63, 122, 77, 0.07);
  --table-stripe: #f2f7f3;
  --sidebar-bg: #11352e;
  --sidebar-text: #edf8f2;
  --sidebar-muted: #bed2c9;
  --sidebar-border: rgba(255, 255, 255, 0.13);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
  --sidebar-active-bg: rgba(216, 169, 40, 0.18);
  --sidebar-accent: #f0c95b;
  --toggle-bg: rgba(255, 255, 255, 0.94);
  --toggle-border: rgba(17, 110, 138, 0.25);
  --feature-media-bg: linear-gradient(135deg, rgba(17, 110, 138, 0.13), rgba(63, 122, 77, 0.1) 48%, rgba(216, 169, 40, 0.14)), var(--surface-1);
  --feature-monogram-color: rgba(17, 110, 138, 0.15);
  --chart-card-bg: linear-gradient(150deg, rgba(17, 110, 138, 0.07), rgba(63, 122, 77, 0.05), rgba(255, 255, 255, 0.92));
  --gefs-card-bg: linear-gradient(180deg, rgba(247, 250, 248, 0.78) 0%, rgba(255, 255, 255, 1) 34%);
  --gefs-card-shadow: 0 10px 24px rgba(17, 47, 38, 0.06);
  --gefs-head-bg: linear-gradient(90deg, rgba(17, 110, 138, 0.06) 0%, rgba(63, 122, 77, 0.05) 55%, rgba(216, 169, 40, 0.035) 100%);
  --gefs-plot-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 248, 0.64) 100%);
  --gefs-plot-grid: rgba(148, 163, 184, 0.06);
}

html.dark-theme,
body.dark-theme {
  color-scheme: dark;
  --accent-color: #8fd0e6;
  --accent-hover: #bce9f4;
  --accent-soft: rgba(143, 208, 230, 0.14);
  --accent-soft-strong: rgba(143, 208, 230, 0.24);
  --button-bg: #176d83;
  --button-hover: #11576a;
  --button-text: #ffffff;
  --highlight-color: #f0c95b;
  --background-color: #08110f;
  --background-gradient: linear-gradient(180deg, rgba(23, 109, 131, 0.16) 0%, rgba(63, 122, 77, 0.08) 9rem, rgba(8, 17, 15, 0) 22rem);
  --surface-1: #101a18;
  --surface-2: #16231f;
  --surface-3: #1f332c;
  --text-color: #f2f7f4;
  --text-muted: #c7d6ce;
  --text-subtle: #99ad9f;
  --border-color: #2b4037;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 10px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 32px rgba(0, 0, 0, 0.55);
  --note-bg: #2d250f;
  --note-text: #f3d47d;
  --note-border: #c69a2b;
  --info-bg: rgba(143, 208, 230, 0.16);
  --info-border: rgba(143, 208, 230, 0.31);
  --info-text: #d9f1ee;
  --info-warning: #fbbf24;
  --code-bg: #17251f;
  --code-text: #f2a6b2;
  --blockquote-bg: rgba(143, 208, 230, 0.08);
  --table-stripe: #16231f;
  --sidebar-bg: #0d211c;
  --sidebar-text: #eaf7ef;
  --sidebar-muted: #b9cec4;
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-hover-bg: rgba(143, 208, 230, 0.12);
  --sidebar-active-bg: rgba(240, 201, 91, 0.18);
  --sidebar-accent: #f0c95b;
  --toggle-bg: rgba(16, 26, 24, 0.94);
  --toggle-border: rgba(143, 208, 230, 0.28);
  --feature-media-bg: linear-gradient(135deg, rgba(143, 208, 230, 0.13), rgba(91, 165, 116, 0.11) 48%, rgba(240, 201, 91, 0.1)), var(--surface-1);
  --feature-monogram-color: rgba(143, 208, 230, 0.15);
  --chart-card-bg: linear-gradient(150deg, rgba(143, 208, 230, 0.17), rgba(91, 165, 116, 0.12), rgba(16, 26, 24, 0.96));
  --gefs-card-bg: linear-gradient(180deg, rgba(16, 26, 24, 0.96) 0%, rgba(13, 23, 21, 1) 36%);
  --gefs-card-shadow: 0 12px 28px rgba(0, 0, 0, 0.46);
  --gefs-head-bg: linear-gradient(90deg, rgba(23, 109, 131, 0.28) 0%, rgba(63, 122, 77, 0.2) 55%, rgba(240, 201, 91, 0.1) 100%);
  --gefs-plot-bg: linear-gradient(180deg, rgba(18, 31, 27, 0.96) 0%, rgba(12, 23, 21, 0.92) 100%);
  --gefs-plot-grid: rgba(148, 163, 184, 0.12);
}

body {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  font-size: var(--font-size-body);
  line-height: 1.7;
  background-color: var(--background-color);
  background-image: var(--background-gradient);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 60rem;
}

@media (min-width: 76em) {
  .container {
    max-width: 64rem;
  }
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  color: var(--text-color);
  letter-spacing: 0;
}

.content a {
  color: var(--accent-color);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.content a:hover {
  color: var(--accent-hover);
}

.theme-base-0b .container.content a {
  color: var(--accent-color);
}

.theme-base-0b .container.content a:hover,
.theme-base-0b .container.content a:focus {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

strong,
b {
  color: var(--text-color);
}

hr {
  border-top-color: var(--border-color);
  border-bottom-color: transparent;
}

abbr {
  color: var(--text-muted);
}

code {
  color: var(--code-text);
  background-color: var(--code-bg);
}

pre,
.highlight {
  color: var(--text-muted);
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.highlight pre {
  border: 0;
  background-color: transparent;
}

blockquote {
  color: var(--text-muted);
  background-color: var(--blockquote-bg);
  border-left-color: var(--border-color);
  border-radius: var(--radius-sm);
}

.message {
  color: var(--text-muted);
  background-color: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.content table {
  color: var(--text-color);
  background-color: var(--surface-1);
  border-color: var(--border-color);
}

.content th,
.content td {
  border-color: var(--border-color);
}

.content th {
  background-color: var(--surface-2);
  color: var(--text-color);
}

.content tbody tr:nth-child(odd) td,
.content tbody tr:nth-child(odd) th {
  background-color: var(--table-stripe);
}

.page,
.post {
  color: var(--text-color);
}

.page-title,
.post-title,
.post-title a {
  color: var(--text-color);
}

.post-date,
.related-posts li small,
.pagination {
  color: var(--text-subtle);
}

.related {
  border-top-color: var(--border-color);
}

.pagination-item {
  background-color: var(--surface-1);
  border-color: var(--border-color);
}

a.pagination-item:hover {
  background-color: var(--surface-2);
}

.masthead {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.masthead .container {
  padding-left: 4.25rem;
}

.masthead-title,
.masthead-title a,
.theme-base-0b .masthead-title a {
  color: var(--text-color);
}

.masthead-title small {
  color: var(--text-subtle);
}

@media (max-width: 48em) {
  .masthead .container {
    padding-right: 4.25rem;
  }
}

html.dark-theme .highlight .c,
html.dark-theme .highlight .c1,
html.dark-theme .highlight .cm,
html.dark-theme .highlight .cs,
body.dark-theme .highlight .c,
body.dark-theme .highlight .c1,
body.dark-theme .highlight .cm,
body.dark-theme .highlight .cs {
  color: #91aa9c;
}

html.dark-theme .highlight .k,
html.dark-theme .highlight .kc,
html.dark-theme .highlight .kd,
html.dark-theme .highlight .kn,
html.dark-theme .highlight .kp,
html.dark-theme .highlight .kr,
html.dark-theme .highlight .kt,
body.dark-theme .highlight .k,
body.dark-theme .highlight .kc,
body.dark-theme .highlight .kd,
body.dark-theme .highlight .kn,
body.dark-theme .highlight .kp,
body.dark-theme .highlight .kr,
body.dark-theme .highlight .kt {
  color: #8fd0e6;
}

html.dark-theme .highlight .s,
html.dark-theme .highlight .sb,
html.dark-theme .highlight .sc,
html.dark-theme .highlight .sd,
html.dark-theme .highlight .s1,
html.dark-theme .highlight .s2,
html.dark-theme .highlight .se,
html.dark-theme .highlight .sh,
html.dark-theme .highlight .si,
html.dark-theme .highlight .sx,
body.dark-theme .highlight .s,
body.dark-theme .highlight .sb,
body.dark-theme .highlight .sc,
body.dark-theme .highlight .sd,
body.dark-theme .highlight .s1,
body.dark-theme .highlight .s2,
body.dark-theme .highlight .se,
body.dark-theme .highlight .sh,
body.dark-theme .highlight .si,
body.dark-theme .highlight .sx {
  color: #f7b267;
}

html.dark-theme .highlight .m,
html.dark-theme .highlight .mf,
html.dark-theme .highlight .mh,
html.dark-theme .highlight .mi,
html.dark-theme .highlight .mo,
body.dark-theme .highlight .m,
body.dark-theme .highlight .mf,
body.dark-theme .highlight .mh,
body.dark-theme .highlight .mi,
body.dark-theme .highlight .mo {
  color: #f0c95b;
}

html.dark-theme .highlight .na,
html.dark-theme .highlight .nc,
html.dark-theme .highlight .nf,
html.dark-theme .highlight .nl,
html.dark-theme .highlight .nn,
html.dark-theme .highlight .nt,
body.dark-theme .highlight .na,
body.dark-theme .highlight .nc,
body.dark-theme .highlight .nf,
body.dark-theme .highlight .nl,
body.dark-theme .highlight .nn,
body.dark-theme .highlight .nt {
  color: #a6dff0;
}

html.dark-theme .highlight .nb,
html.dark-theme .highlight .no,
html.dark-theme .highlight .nv,
html.dark-theme .highlight .bp,
html.dark-theme .highlight .vc,
html.dark-theme .highlight .vg,
html.dark-theme .highlight .vi,
body.dark-theme .highlight .nb,
body.dark-theme .highlight .no,
body.dark-theme .highlight .nv,
body.dark-theme .highlight .bp,
body.dark-theme .highlight .vc,
body.dark-theme .highlight .vg,
body.dark-theme .highlight .vi {
  color: #b8e0d2;
}

html.dark-theme .highlight .o,
html.dark-theme .highlight .ow,
html.dark-theme .highlight .p,
body.dark-theme .highlight .o,
body.dark-theme .highlight .ow,
body.dark-theme .highlight .p {
  color: #d7e5dc;
}

html.dark-theme .highlight .err,
body.dark-theme .highlight .err {
  color: #ffd2d7;
  background-color: #5b1f2a;
}

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

/* Legacy callout boxes used by older notes */
.red-box,
.green-box,
.yellow-box,
.gray-box,
.purple-box,
.blue-box {
  margin: 0.85rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background-color: var(--surface-2);
}

.red-box {
  border-left-color: #dc2626;
  background-color: rgba(220, 38, 38, 0.08);
}

.green-box {
  border-left-color: #16a34a;
  background-color: rgba(22, 163, 74, 0.08);
}

.yellow-box {
  border-left-color: var(--highlight-color);
  background-color: var(--note-bg);
}

.gray-box {
  border-left-color: var(--text-subtle);
}

.purple-box {
  border-left-color: #7c3aed;
  background-color: rgba(124, 58, 237, 0.08);
}

.blue-box {
  border-left-color: var(--accent-color);
  background-color: var(--info-bg);
}

/* Shared card styling */
.home-intro,
.home-content,
.about-card,
.research-categories,
.publication-section,
.future-content,
.teaching-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background-color: var(--surface-1);
}

.home-highlight-card,
.research-area,
.research-poster-feature,
.research-software-note,
.software-overview-item,
.software-project,
.software-sample,
.software-github-cta,
.teaching-resource-panel {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

/* Home page styles */
.home-section {
  margin: var(--space-section) auto;
  max-width: var(--page-max-width);
  text-align: center;
}

.home-intro {
  text-align: center;
  padding: var(--space-section);
}

.intro-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  object-fit: cover;
  border: 3px solid var(--surface-2);
}

.page-title,
.home-title,
.blog-title,
.contact-title,
.cv-header h1,
.research-section h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.55rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.page-header,
.blog-header,
.cv-header,
.research-hero,
.software-hero {
  max-width: var(--content-max-width);
  margin: 0 auto var(--space-section);
  text-align: center;
}

.home-subtitle {
  margin: 0.2rem auto 1.05rem;
  color: var(--accent-color);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
}

.intro-text,
.page-lede,
.blog-intro,
.contact-description,
.software-intro,
.cv-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.home-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.85rem;
  margin-top: 1.1rem;
  text-align: left;
}

.home-highlight-card {
  min-height: 100%;
  padding: 1rem;
}

.home-highlight-card span {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  margin-bottom: 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.home-highlight-card h2 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  margin: 0 0 0.4rem;
  color: var(--text-color);
  font-size: 1.08rem;
  line-height: 1.3;
}

.home-highlight-card h2 code {
  color: var(--accent-color);
  font-family: inherit;
}

.home-highlight-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.home-highlight-card a {
  color: var(--accent-color);
  font-weight: 700;
}

.home-highlight-card a:hover {
  color: var(--accent-hover);
}

.home-content {
  margin-top: var(--space-section);
  padding: var(--space-section);
  background-color: var(--surface-2);
  text-align: left;
}

.section-heading {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.research-list {
  list-style: none;
  padding: 0;
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-muted);
}

.research-list li {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.plot-container {
  margin: calc(var(--space-section) + 0.25rem) auto;
  max-width: 920px;
  padding: 0;
  box-shadow: none;
}

.plot-container .section-heading {
  margin-bottom: 0.55rem;
}

.note-box {
  margin: 0.65rem auto 0.85rem;
  max-width: 800px;
  text-align: left;
  padding: 0.72rem 0.9rem;
  background-color: var(--note-bg);
  border-left: 5px solid var(--note-border);
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--note-text);
}

.plot-iframe {
  width: 100%;
  height: 58vh;
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.usgs-iv-plot .plot-iframe,
.gefs-forecast-panel .plot-iframe {
  height: 44vh;
  min-height: 280px;
}

#loading {
  font-style: italic;
  color: var(--text-subtle);
  margin-bottom: 1rem;
}

.plot-status {
  font-size: 0.92rem;
  color: var(--info-text);
  margin: 0.65rem 0 0.85rem;
  text-align: left;
  background-color: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
}

.plot-status--error {
  border-color: rgba(251, 146, 60, 0.4);
}

.plot-status__title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

html.dark-theme .plot-status__title,
body.dark-theme .plot-status__title {
  color: var(--text-color);
}

.plot-status__meta {
  font-size: 0.88rem;
  color: var(--info-text);
}

.plot-status__warning {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--info-warning);
}

.plot-stage {
  position: relative;
  overflow: hidden;
  background-color: var(--surface-1);
}

.usgs-iv-plot {
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gefs-card-bg);
  box-shadow: var(--gefs-card-shadow);
  overflow: hidden;
}

.usgs-iv-plot .plot-status {
  margin: 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  padding: 0.74rem 0.9rem 0.55rem;
  background: var(--gefs-head-bg);
}

.usgs-iv-plot .plot-stage {
  border-top: 0;
  background:
    var(--gefs-plot-bg),
    repeating-linear-gradient(
      0deg,
      var(--gefs-plot-grid) 0px,
      var(--gefs-plot-grid) 1px,
      transparent 1px,
      transparent 30px
    );
}

.usgs-iv-plot .plot-caption {
  margin-top: 0;
  padding: 0.52rem 0.9rem 0.75rem;
}

.usgs-iv-plot__chart {
  width: 100%;
  height: 100%;
}

.gefs-forecast-precip,
.gefs-forecast-soil {
  width: 100%;
  height: 100%;
}

.gefs-forecast-panel {
  text-align: left;
}

.gefs-chart-card {
  margin-top: 0.82rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--gefs-card-bg);
  box-shadow: var(--gefs-card-shadow);
  overflow: hidden;
}

.gefs-chart-card__head {
  padding: 0.74rem 0.9rem 0.46rem;
  background: var(--gefs-head-bg);
}

.gefs-chart-card__head h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-color);
}

.gefs-chart-card__head p {
  margin: 0.24rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text-subtle);
}

.gefs-chart-card .plot-stage {
  border-top: 1px solid var(--border-color);
  background:
    var(--gefs-plot-bg),
    repeating-linear-gradient(
      0deg,
      var(--gefs-plot-grid) 0px,
      var(--gefs-plot-grid) 1px,
      transparent 1px,
      transparent 30px
    );
}

.plot-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  text-align: center;
  color: var(--text-subtle);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-1));
  z-index: 2;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.plot-skeleton__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent-color);
  animation: plot-spin 0.9s linear infinite;
}

.plot-skeleton__text {
  font-size: 0.95rem;
}

.plot-caption {
  margin-top: 0.62rem;
  font-size: 0.86rem;
  color: var(--text-subtle);
  text-align: left;
}

.plot-caption__sep {
  margin: 0 0.35rem;
  color: var(--border-color);
}

.usgs-iv-plot.is-loaded .plot-skeleton {
  opacity: 0;
  visibility: hidden;
}

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

@media (max-width: 600px) {
  .profile-pic {
    width: 120px;
    height: 120px;
  }
  .plot-iframe {
    height: 46vh;
  }
  .usgs-iv-plot .plot-iframe,
  .gefs-forecast-panel .plot-iframe {
    height: 46vh;
    min-height: 230px;
  }
  .home-highlights {
    grid-template-columns: 1fr;
  }
  .home-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* About page styles */
.about-section {
  margin: var(--space-section) auto;
  max-width: var(--page-max-width);
}

.about-card {
  padding: var(--space-section);
}

.about-card + .about-card {
  margin-top: var(--space-section);
}

.intro-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.highlights-section,
.projects-section,
.beyond-research-section {
  background-color: var(--surface-2);
}

.about-list {
  list-style: none;
  padding: 0;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
  color: var(--text-muted);
}

.about-list li {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-list.about-list-disc {
  list-style: disc;
  padding-left: 1.5rem;
}

.about-highlight-list li {
  padding-left: 0.85rem;
  border-left: 3px solid var(--highlight-color);
}

/* Contact page styles */
.contact-section {
  text-align: center;
  margin: 0 auto var(--space-section);
  max-width: 900px;
  padding: 0;
}

.contact-title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.contact-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.contact-list li {
  font-size: 1.1rem;
}

.contact-list a {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 9.25rem;
  font-weight: 600;
  background-color: var(--surface-1);
  border: 1px solid var(--border-color);
  padding: 0.62rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: color 0.3s ease, transform 0.2s ease, background-color 0.3s ease;
}

.contact-list a:hover {
  color: var(--accent-color);
  transform: translateY(-2px);
  background-color: var(--surface-3);
}

.contact-list i {
  font-size: 1.6rem;
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.contact-list i:hover {
  color: var(--accent-hover);
}

/* Research page styles */
.research-section {
  margin: var(--space-section) auto;
  max-width: var(--page-max-width);
  text-align: center;
}

.research-hero {
  max-width: var(--content-max-width);
  margin: 0 auto var(--space-section);
}

.research-categories,
.publication-section,
.workshops-section {
  text-align: left;
  padding: 1.5rem;
  background-color: var(--surface-1);
}

.publication-section {
  margin-top: var(--space-section);
  background-color: var(--surface-2);
}

.research-area-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
  text-align: left;
}

.research-area {
  min-height: 100%;
  padding: 1rem;
}

.research-area span {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  margin-bottom: 0.55rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.research-area h2 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1.18rem;
  line-height: 1.3;
  margin: 0 0 0.45rem;
}

.research-area p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.research-poster-feature {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: center;
  margin-top: var(--space-section);
  padding: 1.2rem;
  text-align: left;
}

.research-poster-feature__media {
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--surface-2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.research-poster-feature__media img {
  display: block;
  width: 100%;
  height: auto;
}

.research-poster-feature__body h2 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  margin: 0 0 0.65rem;
  color: var(--text-color);
  font-size: 1.38rem;
  line-height: 1.25;
}

.research-poster-feature__body p {
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.research-poster-feature__details {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.research-poster-feature__details div {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  gap: 0.75rem;
}

.research-poster-feature__details dt {
  color: var(--text-color);
  font-weight: 700;
}

.research-poster-feature__details dd {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.research-poster-feature__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.research-section h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.55rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.research-categories h2,
.publication-section h2,
.workshops-section h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.research-categories ul,
.workshops-section ul {
  list-style-type: disc;
  padding-left: 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.publication-section ul li {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.publication-section ul li a {
  color: var(--accent-color);
  text-decoration: underline;
}

.publication-section ul li a:hover {
  text-decoration: none;
  color: var(--accent-hover);
}

.research-output-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.publication-section .research-output-item {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.research-output__status {
  display: inline-flex;
  justify-content: center;
  min-height: 1.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.research-software-note {
  margin-top: var(--space-section);
  padding: 1.1rem 1.25rem;
  text-align: left;
}

.research-software-note h2 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1.22rem;
  margin: 0 0 0.45rem;
}

.research-software-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .research-area-grid,
  .research-poster-feature,
  .publication-section .research-output-item {
    grid-template-columns: 1fr;
  }

  .research-poster-feature__details div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* Software page styles */
.software-section {
  max-width: var(--page-max-width);
  margin: var(--space-section) auto;
  padding: var(--space-section) 0;
}

.software-hero {
  text-align: center;
  max-width: var(--content-max-width);
  margin: 0 auto var(--space-section);
}

.software-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.software-intro {
  max-width: 680px;
  margin: 0.85rem auto 0;
  color: var(--text-muted);
  font-size: 1.12rem;
  line-height: 1.75;
}

.software-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.45rem 0 1.2rem;
}

.software-overview-item {
  min-height: 100%;
  padding: 0.9rem;
}

.software-overview-item i {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
}

.software-overview-item h3 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.software-overview-item p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
}

.software-feature {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
  margin: 1.75rem 0;
  padding: clamp(1.15rem, 3vw, 1.8rem);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-1), var(--surface-2));
  box-shadow: var(--shadow-md);
}

.software-feature__media {
  min-height: 180px;
  border-radius: var(--radius-sm);
  background: var(--feature-media-bg);
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.software-feature__icon {
  width: 74px;
  height: 74px;
  z-index: 1;
}

.software-feature__monogram {
  position: absolute;
  right: 0.7rem;
  bottom: -0.8rem;
  color: var(--feature-monogram-color);
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
}

.software-feature__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.software-feature__eyebrow span {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.software-feature h2 {
  color: var(--text-color);
  font-size: 1.65rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.software-feature h2 code {
  color: var(--accent-color);
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
}

.software-feature p,
.software-samples__header p,
.software-project p,
.software-sample p,
.software-github-cta p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.software-feature__details {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
  gap: 1rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.software-feature__status h3,
.software-feature__checks strong {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1rem;
}

.software-feature__status h3 {
  margin: 0 0 0.4rem;
}

.software-feature__status p {
  margin-bottom: 0.45rem;
}

.software-feature__checks {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.software-feature__checks li {
  display: grid;
  gap: 0.15rem;
}

.software-feature__checks span {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.software-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.05rem;
}

.software-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--button-bg);
  background-color: var(--button-bg);
  color: var(--button-text) !important;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.software-button:hover {
  background-color: var(--button-hover);
  border-color: var(--button-hover);
  color: var(--button-text) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.software-button--secondary {
  background-color: var(--surface-1);
  color: var(--accent-color) !important;
}

.software-button--secondary:hover {
  background-color: var(--surface-3);
  color: var(--accent-hover) !important;
}

.software-samples {
  margin: 1.75rem 0;
  padding: 1.45rem 0 0;
  border-top: 1px solid var(--border-color);
}

.software-samples__header {
  max-width: 760px;
  margin-bottom: 1rem;
}

.software-samples__header h2,
.software-github-cta h3 {
  color: var(--text-color);
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

.software-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.software-project {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1rem;
}

.software-project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.software-project__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background-color: var(--info-bg);
  color: var(--info-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.software-project h3 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1.18rem;
  margin: 0 0 0.45rem;
}

.software-project h3 code {
  color: var(--accent-color);
  font-family: inherit;
}

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

.software-project a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
}

.software-project a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.software-sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.software-sample {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1rem;
}

.software-sample__icon {
  display: inline-grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  margin-bottom: 0.7rem;
  border-radius: var(--radius-sm);
  background-color: var(--info-bg);
  color: var(--accent-color);
}

.software-sample h3 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.software-sample p {
  margin-bottom: 0.8rem;
}

.software-sample a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
}

.software-sample a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.software-github-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background-color: var(--surface-2);
}

.software-github-cta h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.software-github-cta p {
  margin-bottom: 0;
}

.software-github-cta__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.software-updated {
  margin-bottom: 0;
  color: var(--text-subtle) !important;
  font-size: 0.95rem !important;
}

@media (max-width: 920px) {
  .software-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .software-feature {
    grid-template-columns: 1fr;
  }

  .software-feature__media {
    min-height: 130px;
  }

  .software-overview,
  .software-feature__details,
  .software-project-grid,
  .software-sample-grid {
    grid-template-columns: 1fr;
  }

  .software-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .software-button {
    width: 100%;
  }

  .software-github-cta {
    align-items: stretch;
    flex-direction: column;
  }

  .software-github-cta__actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Blog page styles */
.blog-section {
  max-width: var(--page-max-width);
  margin: var(--space-section) auto;
  text-align: center;
  padding: 0;
}

.blog-header {
  margin-bottom: var(--space-section);
  text-align: center;
}

.blog-title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.55rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.blog-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

.posts {
  max-width: 900px;
  margin: 0 auto;
}

.post {
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--surface-1);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.post-title a {
  font-size: 1.35rem;
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

.post-title a:hover {
  color: var(--accent-hover);
}

.post-meta {
  color: var(--text-subtle);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.post-meta strong {
  color: var(--text-muted);
}

.post-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.read-more {
  font-size: 0.95rem;
  color: var(--accent-color);
  text-decoration: underline;
  transition: color 0.3s;
}

.read-more:hover {
  color: var(--accent-hover);
}

.no-posts {
  margin-top: 2rem;
  padding: 1rem;
  background-color: var(--note-bg);
  border-left: 6px solid var(--note-border);
  border-radius: var(--radius-md);
  text-align: left;
}

.no-posts h3 {
  font-size: var(--font-size-h3);
  color: var(--note-text);
  margin-bottom: 1rem;
}

.no-posts p {
  font-size: 1.05rem;
  color: var(--note-text);
  line-height: 1.8;
}

/* CV page styles */
.cv-section {
  text-align: center;
  margin: var(--space-section) auto;
  max-width: 900px;
}

.cv-header h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.55rem;
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.cv-section p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.cv-header .page-lede {
  margin-bottom: 0;
}

.cv-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--button-text) !important;
  background-color: var(--button-bg);
  text-decoration: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.cv-download:hover {
  background-color: var(--button-hover);
  color: var(--button-text) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Teaching page styles */
.teaching-resource-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--page-max-width);
  margin: 0 auto var(--space-section);
  padding: 1.15rem 1.25rem;
}

.teaching-resource-panel__copy {
  text-align: left;
}

.teaching-resource-panel__copy h2 {
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  color: var(--text-color);
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}

.teaching-resource-panel__copy p:not(.software-kicker) {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.teaching-resource-panel__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.teaching-accordion {
  max-width: var(--page-max-width);
  margin: 2rem auto 0;
}

.teaching-item {
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teaching-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.teaching-intro {
  font-size: 1.05rem;
}

.teaching-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.teaching-list li {
  margin-bottom: 0.5rem;
}

.teaching-link {
  font-size: 1.05rem;
  color: var(--accent-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.teaching-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.teaching-colab {
  margin-top: 1rem;
}

.teaching-subheading {
  font-size: var(--font-size-h3);
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.future-content {
  max-width: var(--page-max-width);
  margin: var(--space-section) auto 0;
  padding: 1rem 1.1rem;
  background-color: var(--note-bg);
  border-left: 4px solid var(--note-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.future-content h3 {
  font-size: var(--font-size-h3);
  color: var(--note-text);
  margin-bottom: 1rem;
}

.future-content p {
  font-size: 1.05rem;
  color: var(--note-text);
  line-height: 1.8;
}

@media (max-width: 760px) {
  .teaching-resource-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .teaching-resource-panel__actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.teaching-accordion .accordion-item {
  color: var(--text-color);
  background-color: var(--surface-1);
  border-color: var(--border-color);
  border-radius: var(--radius-md);
}

.teaching-accordion .accordion-header {
  margin: 0;
}

.teaching-accordion .accordion-button {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  background-color: var(--surface-1);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.teaching-accordion .accordion-button:not(.collapsed) {
  color: var(--text-color);
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
}

.teaching-accordion .accordion-button:hover,
.teaching-accordion .accordion-button:focus {
  background-color: var(--surface-3);
}

.teaching-accordion .accordion-button::after {
  filter: grayscale(1) opacity(0.7);
}

html.dark-theme .teaching-accordion .accordion-button::after,
body.dark-theme .teaching-accordion .accordion-button::after {
  filter: invert(1) grayscale(1) opacity(0.82);
}

.teaching-accordion .accordion-body {
  color: var(--text-muted);
  background-color: var(--surface-1);
}

/* Utility */
.section-divider {
  border-bottom: 3px solid var(--highlight-color);
  display: inline-block;
  padding-bottom: 0.3rem;
  margin-bottom: 2rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: 1rem auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sidebar-border);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  color: var(--sidebar-text);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--sidebar-hover-bg);
  border-color: var(--sidebar-accent);
  transform: translateY(-1px);
}

.theme-toggle i {
  font-size: 1rem;
}

.page-header {
  text-align: center;
  margin-bottom: var(--space-section);
}

/* Sidebar polish */
.sidebar,
.theme-base-0b .sidebar {
  color: var(--sidebar-muted);
  background-color: var(--sidebar-bg);
  box-shadow: inset -1px 0 0 var(--sidebar-border), 8px 0 24px rgba(0, 0, 0, 0.18);
}

.sidebar a,
.theme-base-0b .sidebar a {
  color: var(--sidebar-text);
}

.sidebar a:hover,
.sidebar a:focus {
  color: #ffffff;
}

.sidebar-nav {
  margin-top: 1rem;
  border-bottom-color: var(--sidebar-border);
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-item {
  border-top-color: var(--sidebar-border);
  color: var(--sidebar-text);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav-item.active,
a.sidebar-nav-item:hover,
a.sidebar-nav-item:focus {
  color: #ffffff;
  background-color: var(--sidebar-active-bg);
  border-color: transparent;
}

.sidebar-item {
  color: var(--sidebar-muted);
  border-top: 1px solid var(--sidebar-border);
  padding-top: 1rem;
}

.sidebar-item p,
.sidebar-footer p {
  color: var(--sidebar-muted);
}

.sidebar-item img {
  margin-bottom: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  color: var(--sidebar-muted);
  border-top: 1px solid var(--sidebar-border);
  padding-top: 1rem;
}

.sidebar-toggle,
.theme-base-0b .sidebar-toggle {
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  color: var(--accent-color);
  background-color: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  z-index: 20;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.3s ease-in-out;
}

.sidebar-toggle::before {
  width: 1.45rem;
  height: 1.45rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M2.5 11.5A.5.5 0 013 11h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 7h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 3h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M2.5 11.5A.5.5 0 013 11h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 7h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5zm0-4A.5.5 0 013 3h10a.5.5 0 010 1H3a.5.5 0 01-.5-.5z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-toggle:active::before,
#sidebar-checkbox:focus ~ .sidebar-toggle::before,
#sidebar-checkbox:checked ~ .sidebar-toggle::before {
  background: currentColor;
}

.sidebar-toggle:active,
.theme-base-0b .sidebar-toggle:active,
#sidebar-checkbox:focus ~ .sidebar-toggle,
#sidebar-checkbox:checked ~ .sidebar-toggle,
.theme-base-0b #sidebar-checkbox:checked ~ .sidebar-toggle {
  color: var(--button-text);
  background-color: var(--button-bg);
  border-color: var(--button-bg);
}

.theme-base-0b .related-posts li a:hover {
  color: var(--accent-hover);
}

/* Keep masthead size consistent when other libraries are loaded */
.masthead-title {
  font-size: 1.25rem !important;
}
