:root{
  /* dark-mode palette */
  --bg:#0b0f12;
  --surface:#0f1720;
  --text:#e6eef6;
  --muted:#99a0ad;
  --accent:#e0534b;
  --border:#1f2730;
  --soft:#0b1217;
  --max-width:1200px;

  font-family:"Inter", system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}

/* page base */
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-size:16px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* layout container */
.container{
  max-width:var(--max-width);
  margin:0 auto;
  padding:24px 20px;
}

/* header */
.site-header{
  background:linear-gradient(180deg,var(--surface),#0b1116);
  border-bottom:1px solid rgba(255,255,255,0.03);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}

.brand .logo{
  font-size:18px;
  font-weight:700;
  color:var(--text);
  text-decoration:none;
}
.brand .subtitle{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
}

/* nav */
.main-nav a{
  margin-left:16px;
  font-size:14px;
  font-weight:500;
  color:var(--muted);
  text-decoration:none;
}
.main-nav a:hover{color:var(--accent)}

/* main spacing */
main.container{
  padding-top:36px;
  padding-bottom:48px;
}
section{margin-bottom:36px}

/* headings */
section h2, section h3{
  margin:0 0 12px;
  font-weight:600;
  letter-spacing:-0.01em;
}
section h2{font-size:22px}
section h3{font-size:18px}

/* text */
.lead p,
.hero-text p{
  max-width:760px;
  margin:0 0 14px;
  color:var(--muted);
}

/* lists */
ul{margin:8px 0 0 20px; padding:0}
li{margin-bottom:8px}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

/* ========================= */
/* HERO GRID */
/* ========================= */
.hero-grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:28px;
  align-items:start;
  padding-top:20px;
  padding-bottom:24px;
}

/* profile card */
.profile-right{
  background:linear-gradient(180deg,var(--surface),#0b1216);
  border:1px solid var(--border);
  border-radius:8px;
  padding:18px;
  box-shadow:0 8px 30px rgba(2,6,10,0.6);
}
.profile-photo{
  width:160px;
  height:auto;
  object-fit:cover;
  border-radius:999px;
  display:block;
  margin:0 auto 12px;
  border:2px solid rgba(255,255,255,0.03);
  box-shadow:0 8px 18px rgba(2,6,10,0.5);
}
.profile-name{
  text-align:center;
  font-weight:700;
  margin-bottom:4px;
}
.profile-role{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.3;
  margin-bottom:12px;
}

/* icon-only links */
.profile-links{
  display:flex;
  justify-content:center;
  gap:16px;
  margin-bottom:12px;
}
.profile-links a{
  color:var(--accent);
  font-size:18px;
}
.profile-links a:hover{opacity:0.85}

.profile-blurb a{
  color:var(--muted);
  text-decoration:underline;
}
.profile-blurb a:hover{
  color:var(--accent);
}

.profile-links{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}

.profile-links a{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--accent);
  font-size:15px;
}

.profile-links i{
  font-size:18px;
}


/* ========================= */
/* PUBLICATIONS */
/* ========================= */
.pub-year{margin-bottom:48px}
.pub-year h3{
  margin-bottom:18px;
  font-size:20px;
}

.pub-entry{
  display:grid;
  grid-template-columns: 1fr 300px; /* 🔥 BIGGER FIGURES */
  gap:32px;
  align-items:center;
  padding:20px 0;
  border-top:1px solid rgba(255,255,255,0.04);
}
.pub-entry:first-of-type{border-top:none}

.pub-title{
  font-size:16px;
  font-weight:600;
  margin-bottom:6px;
}
.pub-authors{
  font-size:14px;
  margin-bottom:4px;
}
.pub-meta{
  font-size:13px;
  color:var(--muted);
  margin-bottom:8px;
}
.pub-links a{
  margin-right:12px;
  font-size:13px;
}

/* publication figures */
.pub-figure{
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
.pub-figure img{
  width:100%;
  max-width:300px;      /* consistent large size */
  height:auto;
  border-radius:6px;
  border:1px solid rgba(255,255,255,0.06);
  background:linear-gradient(180deg,var(--soft),#081015);
  box-shadow:0 10px 28px rgba(2,6,10,0.7);
}

/* optional separators */
.pub-entry + hr{
  border:none;
  border-top:1px solid rgba(255,255,255,0.04);
  margin:6px 0;
}

/* footer */
.page-footer{
  border-top:1px solid rgba(255,255,255,0.03);
  padding-top:18px;
  margin-top:40px;
  font-size:14px;
  color:var(--muted);
}

/* focus accessibility */
a:focus{
  outline:2px dashed rgba(255,255,255,0.12);
  outline-offset:4px;
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */
@media (max-width:880px){
  .main-nav{display:none}
  main.container{padding-top:24px}

  .hero-grid{grid-template-columns:1fr}
  .profile-right{margin-top:18px}

  .pub-entry{grid-template-columns:1fr}
  .pub-figure{
    margin-top:14px;
    justify-content:flex-start;
  }
  .pub-figure img{max-width:100%}
}

/* ---------- mobile / small screens ---------- */
/* Replace your existing @media (max-width:880px){...} block with this */
@media (max-width:880px){
  /* header - compact and flexible */
  .header-inner{
    flex-direction:row;
    align-items:center;
    gap:12px;
    padding:8px 0;
  }

  /* allow brand to shrink so nav can live on the same row */
  .brand{
    flex:1 1 auto;
    min-width:0; /* important so long names wrap/truncate gracefully */
  }
  .brand .logo{
    font-size:16px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    display:inline-block;
    vertical-align:middle;
  }
  .brand .subtitle{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-top:2px;
  }

  /* show the nav as a horizontal scroller instead of hiding it */
  .main-nav{
    display:flex;
    flex:0 0 auto;
    gap:12px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch; /* smooth scrolling on iOS */
    padding:6px 4px;
    align-items:center;
  }
  .main-nav a{
    white-space:nowrap;
    font-size:14px;
    color:var(--muted);
    padding:6px 8px;
    border-radius:6px;
  }
  .main-nav a:focus,
  .main-nav a:hover{
    color:var(--accent);
    background:rgba(224,83,75,0.04);
  }

  /* overall page spacing */
  main.container{
    padding-top:24px;
  }

  /* hero -> single column */
  .hero-grid{
    grid-template-columns:1fr;
    gap:20px;
  }
  .profile-right{
    order:2;
    margin-top:18px;
  }
  .hero-text{
    order:1;
  }

  /* publications and figures stack nicely */
  .pub-entry{
    grid-template-columns:1fr;
  }
  .pub-figure{
    margin-top:12px;
    justify-content:flex-start;
  }
  .pub-figure img{
    max-width:100%;
    height:auto;
  }
}

/* Research opportunities block */
.research-opps {
  margin: 48px 0;
  text-align: left;
}

/* heading */
.research-heading {
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 700;
}

/* banner / image container */
.research-banner {
  display: flex;
  justify-content: center;   /* center the image */
  margin: 14px 0 20px;
}

/* image sizing — wide but capped so it doesn't dominate phones */
.research-image {
  width: min(960px, 100%);   /* at most 960px wide, shrink to 100% on small screens */
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 10px 30px rgba(2,6,10,0.6);
  display: block;
  object-fit: cover;
}

/* copy */
.research-content {
  max-width: 920px;
  margin: 0 auto; /* center the text column under the image */
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.research-intro { color: var(--text); font-weight:600; margin-bottom:8px; }
.research-body { margin-bottom:10px; }
.research-details { margin-bottom:12px; color: var(--muted); }
.research-funding { margin-top:8px; font-size:14px; color:var(--muted); }
.research-apply { margin-top:12px; color:var(--text); font-weight:600; }

/* small screens: slightly smaller heading and image */
@media (max-width:700px){
  .research-heading { font-size:18px; }
  .research-image { width:100%; max-width:720px; }
  .research-content { padding: 0 6px; }
}

/* ------------------------------------------------------------------
   Layout safety & image constraints (fix right-shift / overflow)
   ------------------------------------------------------------------ */

/* Global image guard: never overflow parent */
img {
  max-width: 100%;
  height: auto;
  display: block;   /* avoids inline spacing issues */
}

/* Ensure the main page container is centered and never overflows */
.container {
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
  max-width: var(--max-width);
  overflow-wrap: break-word; /* avoid long words forcing width */
}

/* Research banner specific safety */
.research-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 14px 0 20px;
  padding: 0 8px;            /* small horizontal padding to avoid touch edges */
}

.research-image {
  width: 100%;
  max-width: 960px;          /* large but capped */
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 10px 30px rgba(2,6,10,0.6);
  object-fit: cover;
  display: block;
}

/* if any grid/hero column is forcing horizontal overflow, make it shrink */
.hero-grid, .page-grid {
  grid-template-columns: 1fr 320px;
  gap: 28px;
  min-width: 0;       /* the important bit: allow children to shrink */
}

/* important: allow direct children to shrink inside grid cells */
.hero-text, .profile-right, .content, .profile-card {
  min-width: 0;
}

/* small safety for very long inline text (links, code, long titles) */
a, p, .pub-title, .course-title {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* last-resort: hide any horizontal overflow (use only if layout still slips) */
html, body {
  /* comment out the next line while tuning layout; enable if you still see horizontal scroll */
  /* overflow-x: hidden; */
}

/* ===== Mobile friendliness fixes (paste at end of style.css) ===== */

/* Prevent header nav from wrapping into vertical stack:
   make it horizontally scrollable on small screens */
@media (max-width: 880px) {
  .header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .main-nav {
    display: block;                  /* show nav, but keep it single-line scroll */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 8px 0 0;
    margin-top: 6px;
  }

  .main-nav a {
    display: inline-block;
    margin: 0 14px 0 0;              /* horizontal spacing */
    vertical-align: middle;
    white-space: nowrap;
  }

  /* Reduce header spacing so nav doesn't push content down too far */
  .site-header { padding: 12px 0; }
}

/* Hero stacking and profile card centering */
@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  /* ensure hero text first, profile card below */
  .hero-text { order: 1; }
  .profile-right { order: 2; margin: 0 auto; width: 100%; max-width: 420px; }

  .profile-right,
  .profile-card {           /* if you still use .profile-card elsewhere */
    border-radius: 8px;
    padding: 16px;
  }

  /* make the profile card visually smaller on small screens */
  .profile-photo {
    width: 200px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  .profile-name { font-size: 18px; }
  .profile-role { font-size: 13px; }
}

/* Reduce large headings on very small screens so they wrap nicely */
@media (max-width: 640px) {
  section h2 { font-size: 20px; }
  section h3 { font-size: 16px; }
  .lead { font-size: 14px; }
  .hero-text p { font-size: 14px; }
}

/* Force single-column publications on phones and make images sit below text */
@media (max-width: 880px) {
  .pub-entry {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .pub-figure {
    width: 100%;
    margin-top: 8px;
  }

  .pub-figure img {
    width: 100%;
    height: auto;
    max-height: 260px; /* keep a consistent "large" size without dominating */
    object-fit: cover;
  }

  /* make pub-title slightly larger for readability on phones */
  .pub-title { font-size: 15px; }
}

/* Prevent accidental extremely long words / URLs from breaking layout */
.content, .container, main, header, footer {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Avoid horizontal overflow overall */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Optional: slightly reduce left/right container padding on very small screens */
@media (max-width: 420px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ===== Header mobile fixes =====
   Paste this at the end of style.css
   Keeps header compact and avoids vertical subtitle text on phones
*/

@media (max-width: 880px) {
  /* make header compact and avoid pushing content down */
  .site-header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* stack brand and nav in a tidy column */
  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* brand row: name on the left, subtitle hidden to avoid vertical text */
  .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }

  /* keep name visible and prominent */
  .brand .logo {
    font-size: 20px;
    line-height: 1;
    margin: 0;
  }

  /* hide the long subtitle on narrow screens to avoid vertical stacking.
     If you prefer showing a short subtitle, replace 'display:none' with a
     smaller font-size and inline layout. */
  .brand .subtitle {
    display: none;
  }

  /* horizontal, scrollable nav that does not wrap into a tall column */
  .main-nav {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    width: 100%;
    padding: 6px 0 0;
    margin: 0;
  }

  .main-nav a {
    display: inline-block;
    margin-right: 18px;
    color: var(--muted);
    font-size: 15px;
    padding: 6px 0;
    text-decoration: none;
  }

  .main-nav a:hover,
  .main-nav a[aria-current="page"] {
    color: var(--accent);
  }

  /* small visual separator line under the header */
  .site-header {
    border-bottom: 1px solid rgba(255,255,255,0.02);
  }
}

/* Extra small phones: reduce nav text a bit more */
@media (max-width: 420px) {
  .main-nav a { font-size: 14px; margin-right: 14px; }
  .brand .logo { font-size: 18px; }
}

/* If you want the subtitle back on phones, uncomment and tweak:
@media (max-width:880px) {
  .brand .subtitle { display:inline-block; font-size:12px; color:var(--muted); }
}
*/

/* ===== Teaching course layout ===== */

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
  margin: 10px 0 26px;
}

.course-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 16px 18px;
}

.course-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.course-meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.course-links a {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}

.course-links a:hover {
  text-decoration: underline;
}

/* Stack to one column on phones */
@media (max-width: 800px) {
  .course-grid {
    grid-template-columns: 1fr;
  }
}


/* soft break helper */
.soft-break{display:none}
@media (max-width:640px){ .soft-break{display:inline} }


