@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');

/* ---------- Theme tokens ---------- */
:root{
  --bg:#0f1419;
  --bg-overlay: rgba(0,0,0,.45);
  --panel:#14202b;
  --card:#1a232d;
  --text:#e8eef5;
  --muted:#aab7c4;
  --link:#7bc4ff;
  --accent:#58a6ff;
  --ring:rgba(255,255,255,.06);

  /* layout helpers */
  --header-h:56px;            /* site header height */
  --subnav-h:36px;            /* pill subnav approx height */
  --menu-min-width: 220px;    /* mobile dropdown width */
  --landing-lift: 28px;       /* raise hero content upward */
}

/* ---------- Base reset & layout ---------- */
*{ box-sizing:border-box }
html, body{ height:100%; margin:0; padding:0 }
body{
  min-height:100%;
  display:flex;
  flex-direction:column;        /* sticky footer layout */
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}
main{ flex:1 }
img{ max-width:100%; display:block }
a{ color:var(--link); text-decoration:none }
a:hover{ text-decoration:underline }

/* ---------- Site header / nav ---------- */
.site-header{
  background:#263544;
  position:sticky; top:0; left:0; right:0;
  width:100%;
  z-index:500; /* bumped on mobile below */
  border-bottom:1px solid rgba(255,255,255,.08);
}
.nav{
  max-width:1200px;
  margin:0 auto;
  padding:.85rem 1rem;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{
  font-family:"Montserrat",sans-serif;
  font-weight:700; font-size:1.4rem; color:#fff;
}
.links a{ margin-left:1rem; opacity:.95 }
.links a[aria-current="page"]{ text-decoration:underline; text-underline-offset:6px }

/* ---------- Backgrounds ---------- */
/* Landing */
.hero{
  position:relative;
  min-height:100vh;
  background:url('../images/hero.jpg') center/cover no-repeat;
  display:grid; place-items:center;
}
.hero-inner{ position:relative; text-align:center; z-index:1; padding:2rem 1rem; max-width:900px }

/* Other pages */
.page-portfolio,
.page-blogs,
.page-contact,
.page-cv{ background:url('../images/hero.jpg') center/cover fixed no-repeat; }

/* About page background image */
.page-about{ background:url('../assets/personal/IMG_5571.jpg') center -170px/cover fixed no-repeat; }

/* ---------- Hero content ---------- */
.hero .avatar{
  width:175px; height:200px; object-fit:cover;
  border-radius:50%; border:4px solid rgba(255,255,255,.85);
  margin:0 auto .55rem;
}
.hero h1{ font-size:3rem; margin:.25rem 0 .35rem }

.hero-tags{
  display:flex; flex-wrap:wrap; gap:.5rem .6rem;
  justify-content:center; align-items:center;
  margin-top:.65rem;
}

.hero-specialties{
  display:flex; flex-wrap:wrap; gap:.5rem .6rem;
  justify-content:center; align-items:center;
  margin-top:1.25rem;
  position:relative; width:fit-content; margin-left:auto; margin-right:auto; padding:.25rem .5rem;
}
.hero-specialties::before{
  content:""; position:absolute; inset:-10px -16px;
  background:rgba(8,12,16,.55); border-radius:18px; filter:blur(8px); z-index:-1;
}

/* Designations */
.hero-designation{
  margin:.8rem 0 0; text-align:center; font-size:1.05rem; color:#fff; text-shadow:0 1px 2px rgba(0,0,0,.4);
  position:relative; width:fit-content; margin-left:auto; margin-right:auto; padding:.25rem .5rem;
}
.hero-designation::before{
  content:""; position:absolute; inset:-8px -14px; background:rgba(8,12,16,.55);
  border-radius:18px; filter:blur(8px); z-index:-1;
}

/* Chips */
.chip{
  display:inline-flex; align-items:center;
  padding:.35rem .7rem; border-radius:999px;
  font-size:.95rem; font-weight:600;
  background:rgba(20,32,43,.9);
  border:1px solid rgba(255,255,255,.12);
  color:#eaf2ff; box-shadow:0 6px 16px rgba(0,0,0,.25);
}
.chip--sm{ font-size:.92rem; padding:.32rem .68rem }
.chip.ghost{ background:rgba(255,255,255,.38); border:1px solid rgba(255,255,255,.48); color:#fff; box-shadow:0 6px 16px rgba(0,0,0,.32) }
.hero-specialties .label{ margin-right:.4rem; font-size:.95rem; font-weight:700; letter-spacing:.02em; color:#cfe2ff; opacity:.95 }

/* Meta (location + email) */
.meta{ margin-top:2rem }
.hero .meta{
  display:flex; justify-content:center; align-items:center; flex-wrap:wrap;
  gap:.5rem; margin-top:.75rem; margin-bottom:2rem;
}
/* divider between location and email (no HTML change needed) */
.hero .meta span + span{
  position:relative; padding-left:.85rem; margin-left:.35rem;
}
.hero .meta span + span::before{
  content:""; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:1px; height:16px; background:rgba(255,255,255,.35);
}
/* email icon in front of address (uses Font Awesome already loaded in index) */
.hero .email a{
  position:relative; padding-left:1.25rem; white-space:nowrap;
}
.hero .email a::before{
  content:"\f0e0"; /* envelope */
  font-family:"Font Awesome 6 Free"; font-weight:900;
  position:absolute; left:0; top:50%; transform:translateY(-50%);
  font-size:.95rem; opacity:.9;
}

/* Intro panel below hero summary */
.intro-panel{
  max-width:900px;
  margin:1rem auto 0;
  padding:1rem 1.5rem;
  font-size:1rem;
  line-height:1.5;
}

/* ---------- Portfolio / Outreach sub-navs ---------- */
.subnav{
  position:sticky; top: 0px;
  z-index:300; /* sits above content but under header on mobile */
  display:flex; gap:1rem; justify-content:center; flex-wrap:wrap;
  padding:.6rem 1rem;
  background:rgba(20,32,43,.92);
  backdrop-filter:blur(4px);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.subnav a{
  color:var(--text); text-decoration:none; font-weight:600;
  padding:.35rem .75rem; border-radius:999px; opacity:.9;
  transition:background .15s ease, opacity .15s ease, border-color .15s ease;
  border:1px solid transparent;
  background: rgba(12,18,24,.75);   /* match Outreach pill style */
}
.subnav a:hover{ background:rgba(255,255,255,.06); opacity:1 }
.subnav a.is-active{ background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18) }

/* Outreach tabs */
.blog-tabs{
  position: sticky; top:0;
  z-index: 300;
  display: flex; gap: 1rem; justify-content: center; flex-wrap:wrap;
  padding: .6rem 1rem;
  background: rgba(20,32,43,.92);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.blog-tabs a, .blog-tabs .tab-btn{
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: .35rem .75rem; border-radius: 999px; opacity: .9;
  transition: background .15s ease, opacity .15s ease, border-color .15s ease;
  border: 1px solid transparent; background: rgba(12,18,24,.75);
}
.blog-tabs a:hover, .blog-tabs .tab-btn:hover{ background: rgba(255,255,255,.06); opacity: 1; }
.blog-tabs a.is-active, .blog-tabs .tab-btn.is-active{ background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }

html{ scroll-behavior:smooth }
/* header (~56) + subnav (~32) ≈ 88px; keep anchor offset */
.anchor-section{ scroll-margin-top: 88px}

/* ---------- Social buttons ---------- */
.social{
  display:flex; gap:1rem; justify-content:center; align-items:center; margin-top:1rem;
}
.social-btn{
  width:56px; height:56px; display:grid; place-items:center;
  border-radius:50%; background:#0b1620; border:1px solid var(--ring);
  color:#text; box-shadow:0 6px 18px rgba(0,0,0,.25);
  transition:transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.social-btn i{ font-size:22px; line-height:1 }
.social-btn:hover{ transform:translateY(-2px); filter:brightness(1.1); box-shadow:0 10px 22px rgba(0,0,0,.32) }

/* ---------- Sections & cards ---------- */
.section{ max-width:1100px; margin:3rem auto; padding:0 1rem }
.section h1,.section h2{ margin:0 0 1rem }

/* Generic cards */
.grid{ display:grid; gap:1rem; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)) }
.card{ background:var(--card); padding:1.25rem; border-radius:14px; border:1px solid var(--ring); box-shadow:0 10px 24px var(--ring) }
.card h3{ margin:.15rem 0 .35rem; font-size:1.15rem }
.muted{ color:var(--muted) }
.btn{ display:inline-block; background:var(--accent); color:#06111a; padding:.65rem 1rem; border-radius:10px; font-weight:700; box-shadow:0 6px 18px rgba(88,166,255,.2) }
.btn:hover{ text-decoration:none; filter:brightness(1.05) }
.link{ font-weight:600 }

/* Publications layout */
.pub-grid{ display:grid; gap:1rem; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)) }
.pub-card{ background:var(--card); padding:1.25rem; border-radius:14px; border:1px solid var(--ring); display:flex; flex-direction:column; gap:.5rem }
.pub-title{ margin:0; font-size:1.05rem }
.pub-citation{ margin:0; color:var(--muted); font-style:italic }
.pub-abstract{ margin:.25rem 0 .75rem; color:#d7e2ec }
.pub-link{ margin-top:auto; font-weight:700 }

/* ---------- About page (overlay + text panel + gallery) ---------- */
.page-overlay{ position:relative; min-height:100%; background:transparent; display:flex; flex-direction:column; }
.page-overlay::after{ content:""; position:fixed; inset:0; background:rgba(0,0,0,0); pointer-events:none; transition:background .25s ease; z-index:0; }
.page-overlay.dark-overlay::after{ background:rgba(0,0,0,.90) }
.page-overlay > *{ position:relative; z-index:1 }

.about-section{ display:flex; justify-content:flex-end; align-items:center; padding:60px 20px; margin:20px; margin-bottom:24px; }
.about-text{ max-width:800px; padding:20px; background:linear-gradient(to right, rgba(44,62,80,.80), rgba(44,62,80,.90)); text-align:justify; border-radius:8px; border:1px solid rgba(255,255,255,.06); }
.about-text h2{ text-align:center; font-size:32px; margin:0 0 20px }
.about-text p{ font-size:16px; line-height:1.6; margin:0 0 15px }

.photo-gallery{ display:flex; flex-wrap:wrap; justify-content:center; gap:20px; margin:30px; }
.gallery-item{ position:relative; width:300px; height:200px; overflow:hidden; border-radius:8px; cursor:pointer; border:1px solid rgba(255,255,255,.06); box-shadow:0 10px 24px rgba(0,0,0,.2); }
.gallery-item.tall{ height:400px; order:0 }
.gallery-item:not(.tall){ height:200px; order:1 }
.gallery-item img{ width:100%; height:100%; object-fit:cover; transition:transform .3s ease-in-out }
.gallery-item:hover img{ transform:scale(1.1) }
.caption-box{ position:absolute; left:0; right:0; bottom:0; height:50%; background:rgba(0,0,0,.70); opacity:0; display:flex; align-items:center; justify-content:center; transition:opacity .25s ease-in-out; }
.gallery-item:hover .caption-box{ opacity:1 }
.caption-text{ font-size:16px; color:#fff; text-align:center }

/* Keep header/footer above overlay */
.site-header, .site-footer{ position:relative; z-index:2 }

/* ---------- Blogs (cards) ---------- */
.post-grid{ display:grid; gap:1.25rem; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)) }
.post-card{ background:rgba(20,32,43,.85); border-radius:12px; overflow:hidden; border:1px solid rgba(255,255,255,.05); max-width:500px; margin:1rem auto; }
.post-media img{ width:100%; height:250px; object-fit:cover; display:block; }
.post-body{ padding:1rem }

/* ---------- Teaching page snippets ---------- */
.quote-card{
  background:rgba(20,32,43,.85);
  border:1px solid rgba(255,255,255,.1); border-radius:14px;
  padding:1.25rem 1.5rem; font-style:italic; line-height:1.6; color:#e0e0e0;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.quote-card blockquote{ margin:0; font-size:.95rem }
.quote-card .quote-source{ margin-top:.75rem; font-size:.85rem; font-style:normal; color:#aab7c4; text-align:right }

/* ---------- CV ---------- */
.cv-section{
  max-width:1100px; margin:2rem auto; padding:1rem;
  background:rgba(20,32,43,.85);
  border-radius:12px; border:1px solid rgba(255,255,255,.05);
}
.cv-section h1{ text-align:center; margin-bottom:1rem }
.cv-section a{ color:var(--link); font-weight:600; text-decoration:underline }
.cv-embed{ margin-top:1.5rem; border:1px solid rgba(255,255,255,.1); border-radius:8px; overflow:hidden }

/* ---------- Contact (legacy) ---------- */
.contact-list{ list-style:none; padding:0; margin:2rem 0; display:grid; gap:.5rem; justify-items:center }
.contact-list li{ opacity:.95 }
.icon-row{ display:flex; gap:1.25rem; justify-content:center; align-items:center; margin-top:1rem }
.icon{ width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:#0b1620; border:1px solid var(--ring) }
.page-contact h1 { text-align: center; margin-bottom: 1.5rem; }

/* ---------- Outreach cards ---------- */
.article-grid{ display:grid; gap:1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.article-card{
  background: rgba(20,32,43,.85);
  border:1px solid rgba(255,255,255,.06);
  border-radius:14px; overflow:hidden;
  box-shadow:0 10px 24px rgba(0,0,0,.2);
  display:grid; grid-template-rows: auto 1fr;
  transition: transform .15s ease, box-shadow .15s ease;
}
.article-card:hover{ transform: translateY(-2px); box-shadow:0 14px 28px rgba(0,0,0,.28); }
.article-media{ display:block; aspect-ratio:16/9; overflow:hidden; background:#0b1620; }
.article-media img{ width:100%; height:100%; object-fit:cover; display:block; transition: transform .3s ease; }
.article-card:hover .article-media img{ transform: scale(1.05) }
.article-body{ padding: .9rem 1rem 1rem; }
.article-title{ font-size:1.05rem; margin:.1rem 0 .25rem; }
.article-title a{ color:#e8eef5; text-decoration:none }
.article-title a:hover{ text-decoration:underline }
.article-meta{ margin:0 0 .5rem; color:#aab7c4; font-size:.9rem }
.article-excerpt{ margin:0 0 .75rem; color:#d7e2ec; font-size:.95rem }
.article-link{ font-weight:700 }

/* ---------- Footer ---------- */
.site-footer{ border-top:1px solid rgba(255,255,255,.08); background:#263544; margin-top:3rem }
.site-footer .inner{ max-width:1200px; margin:0 auto; padding:1rem; color:#d0d9e2; display:flex; justify-content:space-between; flex-wrap:wrap; gap:.75rem }
.small{ font-size:.9rem; opacity:.85 }

/* ---------- Responsive ---------- */
@media (max-width:640px){
  .hero h1{ font-size:2.2rem }
}

/* ---------- Buttons (shared) ---------- */
.btn-card{
  display:inline-block;
  background: rgba(20,32,43,1);
  color: var(--link);
  padding: .65rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: background .15s ease, transform .15s ease;
}
.btn-card:hover{ text-decoration:none; transform: translateY(-2px); }

/* ====================================================================== */
/* ============================ APPEND BEHAVIOR ========================== */
/* ====================================================================== */

/* Lift landing page content a bit */
.hero .hero-inner{ transform: translateY(calc(var(--landing-lift) * -1)); }

/* --- Teaching page tweaks --- */
#t-overview .teaching-intro{ text-align:left; margin-left:0; margin-right:auto; max-width:900px }
#t-overview .btn-card{ margin-top:.5rem }
.teaching-blurb{ margin-top:.35rem; max-width:900px; color:#d7e2ec }

/* Course list */
.course-list{ margin: .5rem 0 0 1.15rem; padding:0 }
.course-list > li{ margin: .4rem 0 1.1rem }
.course-list h3{ margin:0 0 .25rem; font-size:1.05rem }
.course-list ul{ list-style: circle; margin:.25rem 0 0 1.2rem; padding:0 }
.link-download{ color: var(--link); font-weight:600; text-decoration: underline; text-underline-offset: 3px }

/* Eval buttons row */
.eval-actions{ display:flex; gap:.75rem; flex-wrap:wrap; margin-top:1rem }
@media (max-width:640px){ .course-list{ margin-left:.95rem } }

/* Teaching page background + left-aligned titles */
.page-teaching{ background: url('../images/hero.jpg') center/cover fixed no-repeat; }
.page-teaching h1{ text-align:left; }

/* ---------- “Highlights” teaser tab on landing ---------- */
/* Requires: <a class="highlight-tab" href="#highlights">Highlights</a> inside .hero */
.highlight-tab{
  position:absolute; left:1rem; bottom:0;
  transform: translateY(50%); /* peeks out like a browser tab */
  display:inline-block;
  padding:.5rem .75rem;
  background: rgba(20,32,43,.95);
  color:#cfe2ff;
  border:1px solid rgba(255,255,255,.18);
  border-bottom-left-radius:10px; border-bottom-right-radius:10px;
  border-top-left-radius:10px; border-top-right-radius:10px;
  box-shadow:0 8px 18px rgba(0,0,0,.3);
  font-weight:700;
  z-index:3;
}
.highlight-tab:hover{ text-decoration:none; filter:brightness(1.05) }

/* Make the Highlights section title visually “catch” the tab style */
#highlights > h2{
  display:inline-block;
  background: rgba(20,32,43,.95);
  color:#e8eef5;
  padding:.4rem .7rem;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.18);
}

/* Testimonials with accent rule (gold/amber line) */
.testimonials{
  display:grid;
  gap:1rem;
  max-width:900px;
}
.pull-quote{
  position:relative;
  margin:0;
  padding:.75rem 1rem .75rem 1.1rem;
  background: rgba(20,32,43,.85);
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  color:#e8eef5;
  line-height:1.7;
}
.pull-quote::before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:4px;
  background: linear-gradient(180deg, #f4c056, #dca74a);
  border-top-left-radius:12px;
  border-bottom-left-radius:12px;
}

/* ---------- Keep Research subnav visible the whole page ---------- */
.page-portfolio .subnav{
  position: sticky;
  top: 0;          /* sit flush to the very top as you scroll */
  z-index: 300;    /* above content, below the header (header is 600 on mobile) */
}
/* ---------- Mobile header menu above subnav (Research/Outreach) ---------- */
@media (max-width:820px){
  .site-header{ z-index:400 }  /* ensure dropdown (links) is above subnav/blog-tabs */
  .subnav, .blog-tabs{ z-index:300 }
}

/* ---------- Mobile: collapsible subnav (Research) ---------- */
@media (max-width:820px){
  .page-portfolio .subnav{
    position:sticky; top:0;
    padding:.5rem 1rem;
    justify-content:center;
  }

  /* Closed: show trigger */
  .page-portfolio .subnav::after{
    content:"Sections ▾";
    display:inline-block;
    padding:.4rem .75rem;
    border-radius:999px;
    background: rgba(12,18,24,.95);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 8px 18px rgba(0,0,0,.25);
    font-weight:700; color:#e8eef5;
    cursor:pointer; user-select:none;
  }

  /* Hide links until opened (no absolute positioning) */
  .page-portfolio .subnav a{ display:none; }

  /* Open: convert bar into a right-aligned white panel (like main nav / outreach) */
  .page-portfolio .subnav:hover,
  .page-portfolio .subnav:focus-within{
    display:inline-flex;
    flex-direction:column;
    align-items:stretch;
    background:#ffffff;
    color:#0b1620;
    border:1px solid rgba(0,0,0,.08);
    border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    padding:6px 0;
    margin-left:auto;
    margin-right:1rem;
  }
  .page-portfolio .subnav:hover::after,
  .page-portfolio .subnav:focus-within::after{
    content:"Sections ▲";
    padding:10px 14px;
    background:transparent; border:none; box-shadow:none; color:#0b1620;
  }
  .page-portfolio .subnav:hover a,
  .page-portfolio .subnav:focus-within a{
    display:block;
    padding:10px 14px;
    color:#0b1620;
    white-space:nowrap;
    min-width:var(--menu-min-width);
  }
  .page-portfolio .subnav:hover a + a,
  .page-portfolio .subnav:focus-within a + a{
    border-top:1px solid #f1f5f9;
  }
}
/* ---------- Mobile: collapsible tabs (Outreach) — panel list like main nav ---------- */
@media (max-width:820px){
  .blog-tabs{
    position:sticky; top:0;
    padding:.5rem 1rem;
    justify-content:center;
  }

  /* Closed: show trigger */
  .blog-tabs::after{
    content:"Categories ▾";
    display:inline-block;
    padding:.4rem .75rem;
    border-radius:999px;
    background: rgba(12,18,24,.95);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 8px 18px rgba(0,0,0,.25);
    font-weight:700; color:#e8eef5;
    cursor:pointer; user-select:none;
  }
  .blog-tabs .tab-btn{ display:none; }

  /* Open: convert tabs into a white dropdown panel aligned right */
  .blog-tabs:hover,
  .blog-tabs:focus-within{
    display:inline-flex;
    flex-direction:column;
    align-items:stretch;
    background:#ffffff;
    color:#0b1620;
    border:1px solid rgba(0,0,0,.08);
    border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    padding:6px 0;
    margin-left:auto;
    margin-right:1rem;
  }
  .blog-tabs:hover::after,
  .blog-tabs:focus-within::after{
    content:"Categories ▲";
    padding:10px 14px;
    background:transparent;
    border:none;
    box-shadow:none;
    color:#0b1620;
  }
  .blog-tabs:hover .tab-btn,
  .blog-tabs:focus-within .tab-btn{
    display:block;
    padding:10px 14px;
    color:#0b1620;
    white-space:nowrap;
    min-width:var(--menu-min-width);
  }
  .blog-tabs .tab-btn + .tab-btn{ border-top:1px solid #f1f5f9 }
}

/* ---------- Mobile: collapsible subnav (Teaching) — panel list like main nav ---------- */
@media (max-width:820px){
  .page-teaching .subnav{
    position:sticky; top:0;
    padding:.5rem 1rem;
    justify-content:center;
  }

  /* Closed trigger */
  .page-teaching .subnav::after{
    content:"Sections ▾";
    display:inline-block;
    padding:.4rem .75rem;
    border-radius:999px;
    background: rgba(12,18,24,.95);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 8px 18px rgba(0,0,0,.25);
    font-weight:700; color:#e8eef5;
    cursor:pointer; user-select:none;
  }
  .page-teaching .subnav a{ display:none; }

  /* Open panel */
  .page-teaching .subnav:hover,
  .page-teaching .subnav:focus-within{
    display:inline-flex;
    flex-direction:column;
    align-items:stretch;
    background:#ffffff;
    color:#0b1620;
    border:1px solid rgba(0,0,0,.08);
    border-radius:12px;
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    padding:6px 0;
    margin-left:auto;
    margin-right:1rem;
  }
  .page-teaching .subnav:hover::after,
  .page-teaching .subnav:focus-within::after{
    content:"Sections ▲";
    padding:10px 14px;
    background:transparent; border:none; box-shadow:none; color:#0b1620;
  }
  .page-teaching .subnav:hover a,
  .page-teaching .subnav:focus-within a{
    display:block;
    padding:10px 14px;
    color:#0b1620;
    white-space:nowrap;
    min-width:var(--menu-min-width);
  }
  .page-teaching .subnav:hover a + a,
  .page-teaching .subnav:focus-within a + a{
    border-top:1px solid #f1f5f9;
  }
}


/* ---------- Mobile header burger (existing) ---------- */
/* (kept, but we ensure layering with z-index tweaks above) */
@media (max-width: 820px) {
  .site-header .nav{ position:relative }
  .nav .links{
    display:none;
    position:absolute;
    top:100%; right:0; z-index:1000;
    background:#ffffff; color:#0b1620;
    border:1px solid rgba(0,0,0,.08);
    box-shadow:0 10px 24px rgba(0,0,0,.12);
    border-radius:12px; padding:6px 0; min-width:var(--menu-min-width);
    flex-direction:column;
  }
  .nav:hover .links, .nav:focus-within .links{ display:flex }
  .nav .links a{ display:block; padding:10px 14px; color:#0b1620; text-decoration:none; white-space:nowrap }
  .nav .links a + a{ border-top:1px solid #f1f5f9 }
  .nav::after{
    content:"⋯"; display:inline-block; margin-left:auto; font-size:20px; line-height:1;
    padding:8px 12px; color:#fff; border:1px solid rgba(255,255,255,.18);
    background:rgba(255,255,255,.06); border-radius:10px; cursor:pointer; user-select:none;
  }
}

/* ==== Job Market Paper section (append-only) ============================ */
.jmp-intro{
  text-align:left;
  margin-left:0;
  margin-right:auto;

  /* === Research & Job Market Paper text blocks: wider, justified, aligned with titles === */
/* Research overview blurb */
#overview .intro-panel{
  /* fill the full .section width (1100px) instead of the old 900px cap */
  max-width: none;
  /* align left edge with the H1 */
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  /* justify text for a clean column look */
  text-align: justify;
  text-justify: inter-word;
}

/* Job Market Paper abstract */
.jmp-intro{
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  text-align: justify;
  text-justify: inter-word;
}

/* Optional: give the buttons a little breathing room when the text goes wider */
.jmp-section .btn-card,
#overview .btn-card{
  margin-top: .65rem;
}
  max-width:900px;   /* matches Research intro width */
}
.jmp-section .btn-card{ margin-top:.5rem }


/* === Teaching intro: wider, justified, aligned with title === */
.page-teaching #t-overview .teaching-intro,
.page-teaching #t-overview .teaching-blurb{
  max-width: none;      /* use full .section width (1100px) */
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  text-align: justify;
  text-justify: inter-word;
}

/* small spacing tweak for the button under the intro */
.page-teaching #t-overview .btn-card{
  margin-top: .65rem;
}

/* (optional) on very narrow screens, avoid awkward spacing from justification */
@media (max-width: 560px){
  .page-teaching #t-overview .teaching-intro,
  .page-teaching #t-overview .teaching-blurb{
    text-align: left;
  }
}
/* === Research page: wider, justified, aligned with titles ================= */

/* Research overview blurb */
.page-portfolio #overview .intro-panel{
  max-width: none;           /* override 900px cap */
  margin: 1rem 0 0;          /* remove auto centering */
  padding: 0;                /* align flush with the H1 */
  text-align: justify;
  text-justify: inter-word;
}

/* Job Market Paper abstract — covers whichever markup you used */
.page-portfolio #jmp .intro-panel,
.page-portfolio #jmp .jmp-intro,
.page-portfolio #jmp > p{
  max-width: none;
  margin: .5rem 0 0;
  padding: 0;
  text-align: justify;
  text-justify: inter-word;
}

/* Optional: let just these two sections breathe a bit more on large screens */
@media (min-width:1200px){
  .page-portfolio #overview.section,
  .page-portfolio #jmp.section{
    max-width: 1240px;      /* bump over the site-wide 1100px container */
  }
}
