:root {
  --bg-base:        #ffffff;
  --bg-elevated:    #ffffff;
  --bg-soft:        #f6f6f4;
  --bg-hover:       #ececea;

  --text-primary:   #1c1c1a;
  --text-body:      #3a3a36;
  --text-muted:     #75756e;
  --text-faint:     #a3a39a;

  --accent:         #2f3d63;
  --accent-bright:  #4d5f96;
  --accent-soft:    rgba(47, 61, 99, 0.08);
  --accent-line:    rgba(47, 61, 99, 0.28);

  --rule:           #e3e2dd;
  --rule-strong:    #cac9c1;

  --status-published: #3f7d4f;
  --status-review:    #b5792a;
  --status-submitted: #8a7c5c;

  --royal-gold:        #a9781f;
  --royal-gold-bright:  #c9a24b;
  --royal-felt:         #f5ecd2;

  --selection-bg:   rgba(47, 61, 99, 0.16);

  --shadow-soft:    0 1px 0 rgba(20,20,15,0.04), 0 8px 22px -14px rgba(20,20,15,0.14);
  --shadow-lift:    0 18px 40px -18px rgba(20,20,15,0.20);

  --font-display:   'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:      'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono:      'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --radius:         4px;
  --radius-lg:      9px;
  --maxw:           780px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html { scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body);
  background-color: var(--bg-base);
  background-image: radial-gradient(circle, rgba(47, 61, 99, 0.06) 1px, transparent 1.3px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* faint paper fiber, on top of the dot lattice */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.03 0 0 0 0.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius);
}
.skip-link:focus { top: 0.6rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

em { font-style: italic; }
strong { color: var(--text-primary); font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(to right, var(--accent-bright), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease, color 0.18s ease;
}
a:hover, a:focus-visible {
  background-size: 100% 1px;
  color: var(--accent-bright);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}



.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: color-mix(in srgb, var(--bg-base) 92%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-bottom: none;
}


.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--rule-strong) 12%,
    var(--royal-gold) 50%,
    var(--rule-strong) 88%,
    transparent 100%
  );
  opacity: 0.85;
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  background: none;
}

.monogram {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--bg-elevated);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.branding:hover .monogram { color: var(--royal-gold); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.03rem;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.nav-links a {
  position: relative;
  margin: 0 0.15rem;
  padding: 0.45rem 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: none;
  background-image: none;
  transition: color 0.2s ease;
}


.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0.1rem;
  height: 1px;
  background: var(--royal-gold);
  transition: left 0.25s cubic-bezier(.2,.7,.2,1), right 0.25s cubic-bezier(.2,.7,.2,1);
}
.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.active::after {
  left: 0.55rem;
  right: 0.55rem;
}

.nav-links .nav-primary {
  margin-left: 0.55rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--royal-gold);
  border-radius: var(--radius);
  color: var(--royal-gold);
  background-color: var(--bg-elevated);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-links .nav-primary::after { content: none; }
.nav-links .nav-primary::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 9px;
  height: 5px;
  transform: translateX(-50%);
  background: var(--royal-gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: background-color 0.2s ease;
}
.nav-links .nav-primary:hover,
.nav-links .nav-primary:focus-visible {
  background-color: var(--royal-gold);
  color: var(--bg-elevated);
  border-color: var(--royal-gold);
}

@media (prefers-reduced-motion: no-preference) {
  .branding:hover .monogram { transform: rotate(180deg); }
  .award-card:hover { transform: translateX(2px); }
  .skill-chip:hover { transform: translateY(-1px); }
  .notebook-card:hover { transform: translateY(-2px); }
  .notebook-card:hover .notebook-card-read i { transform: translateX(3px); }
  .featured-post-banner:hover { transform: translateY(-1px); }
}

/* Graceful degradation for missing figures — see notes.js/home.js.
   Keeps a broken asset from ever showing a raw browser broken-image
   icon; shows a quiet on-brand placeholder instead. */
.img-fallback {
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: repeating-linear-gradient(135deg, var(--bg-soft), var(--bg-soft) 9px, var(--bg-hover) 9px, var(--bg-hover) 18px);
  border-radius: var(--radius);
}
.img-fallback img { display: none; }
.img-fallback::after {
  content: "Figure unavailable";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  background: var(--bg-elevated);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
}
.img-fallback-inline { opacity: 0; position: absolute; }

.page { padding: 0 0 5rem; position: relative; z-index: 2; }

.page-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content { min-width: 0; }

/* =========================================================
   Hero
   ========================================================= */

.hero {
  padding: 3.4rem 0 3rem;
  text-align: left;
  position: relative;
}

.hero-top {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 2.4rem;
  margin-bottom: 2.3rem;
}

.hero-portrait {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.hero-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  margin: 0;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--rule-strong);
}

/* Small circular icon links under the portrait -- quieter than a row
   of labeled pill buttons, closer to a simple social-icon treatment. */
.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  color: var(--text-muted);
  background: var(--bg-elevated);
  font-size: 0.86rem;
  background-image: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.hero-social a:hover, .hero-social a:focus-visible {
  color: var(--accent);
  border-color: var(--accent-line);
  background-color: var(--accent-soft);
}

.hero-intro {
  grid-column: 2;
  min-width: 0;
}

.hero h1 {
  font-size: 2.6rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}

.hero-bio {
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  margin: 0 0 1.05rem;
}

.hero-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 1.4rem 0 0.7rem;
}
.hero-jump a { color: var(--text-muted); padding: 0.2rem 0.6rem 0.2rem 0; }
.hero-jump a:first-child { padding-left: 0; }
.hero-jump a:hover, .hero-jump a:focus-visible { color: var(--accent); }
.hero-jump a:not(:last-child)::after {
  content: "·";
  margin-left: 0.6rem;
  color: var(--rule-strong);
}

.hero-contact-line {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
}
.hero-contact-line a { color: var(--accent); }
.hero-contact-line a:hover { color: var(--accent-bright); }

/* News strip */
.news-strip {
  margin: 0 0 0;
  padding: 1.1rem 1.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-align: left;
  box-shadow: var(--shadow-soft);
}
.news-strip-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.news-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.news-strip li {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.5;
}
.news-strip .news-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.35rem;
}

/* Featured post banner */
.featured-post-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1rem 0 0;
  background: linear-gradient(135deg, var(--royal-felt), var(--bg-elevated));
  border: 1px solid var(--royal-gold);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.15rem;
  text-align: left;
  text-decoration: none;
  background-image: none;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.featured-post-banner:hover {
  box-shadow: var(--shadow-lift);
}
.featured-post-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--royal-gold-bright), var(--royal-gold));
  color: var(--bg-elevated);
  font-size: 0.8rem;
}
.featured-post-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.featured-post-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--royal-gold);
}
.featured-post-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.featured-post-arrow { margin-left: auto; color: var(--text-muted); flex: none; }
.featured-post-banner:hover .featured-post-arrow { color: var(--royal-gold); }



.section-thread {
  max-width: 640px;
  margin: 0 auto;
}

.section {
  max-width: 640px;
  margin: 0 auto 3.4rem;
  scroll-margin-top: 90px;
  position: relative;
}

.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--text-primary);
  max-width: 52ch;
  margin: 1.6rem 0 0.4rem;
  padding-left: 1.2rem;
  border-left: 2px solid var(--royal-gold);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.section-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--bg-elevated);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-base);
}

.section h2 { font-size: 1.55rem; letter-spacing: -0.015em; }

.subsection-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.subsection-title::before,
.subsection-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.subsection-title::before { flex: 0 0 16px; }
.subsection-title:first-child { margin-top: 0; }

.section p { margin: 0 0 1rem; font-size: 1rem; color: var(--text-body); }

.section p.lede {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}


.lede.drop-cap::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.4rem;
  float: left;
  line-height: 0.82;
  margin: 0.05em 0.09em 0 0;
  color: var(--royal-gold);
}

.research-note {
  padding: 1rem 1.2rem;
  background: var(--bg-elevated);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.2rem 0;
}
.research-note p { margin: 0; color: var(--text-body); font-size: 0.96rem; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.is-published { color: var(--status-published); }
.status-badge.is-review    { color: var(--status-review); }
.status-badge.is-submitted { color: var(--status-submitted); }
.status-badge.is-preprint  { color: var(--accent); }


.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }

.pub-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.1rem;
  padding: 1.05rem 0.7rem;
  border-top: 1px solid var(--rule);
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: border-left-color 0.2s ease, padding-left 0.2s ease, background-color 0.2s ease;
}
.pub-item:first-child { border-top: 0; padding-top: 0.4rem; }
.pub-item:last-child { border-bottom: 1px solid var(--rule); padding-bottom: 1.2rem; }
.pub-item:hover { border-left-color: var(--accent); padding-left: 1rem; background-color: var(--accent-soft); }
.pub-item:hover .pub-year { color: var(--accent); }

.pub-year { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-faint); padding-top: 0.15rem; transition: color 0.2s ease; }
.pub-body { min-width: 0; }
.pub-title { font-family: var(--font-display); font-weight: 500; font-size: 1.02rem; color: var(--text-primary); line-height: 1.4; margin-bottom: 0.4rem; }
.pub-authors { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.pub-authors strong { color: var(--accent); font-weight: 500; }
.pub-venue { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.pub-venue em { color: var(--text-body); font-family: var(--font-display); font-style: italic; }

.pub-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.3rem; }
.doi-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent);
  border-bottom: 1px solid var(--accent-line); background: none;
}
.doi-link:hover { color: var(--accent-bright); border-bottom-color: var(--accent-bright); }

.scholar-note { font-size: 0.85rem; color: var(--text-muted); margin: -0.2rem 0 0.9rem; }
.scholar-note a { color: var(--accent); }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.project-card {
  background: var(--bg-elevated); border: 1px dashed var(--rule-strong); border-radius: var(--radius-lg);
  padding: 1.3rem; text-align: center;
}
.project-desc { color: var(--text-muted); font-style: italic; font-family: var(--font-display); margin: 0 0 1rem; }
.btn-github {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-primary);
  background: var(--bg-soft); border: 1px solid var(--rule-strong);
  padding: 0.45rem 0.85rem; border-radius: var(--radius);
  background-image: none; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-github:hover { background-color: var(--accent); border-color: var(--accent); color: var(--bg-elevated); }

/* Timeline (education) */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 128px 1fr; gap: 1.3rem; padding: 0.85rem 0; border-top: 1px solid var(--rule); }
.timeline-item:first-child { border-top: 0; }
.timeline-date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); padding-top: 0.15rem; }
.timeline-title { font-size: 0.98rem; font-weight: 500; color: var(--text-primary); }
.timeline-place { font-size: 0.88rem; color: var(--text-muted); font-family: var(--font-display); font-style: italic; margin-top: 0.1rem; }
.timeline-extra { font-size: 0.86rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Awards */
.awards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.award-card {
  background: var(--bg-elevated); border: 1px solid var(--rule); border-left: 3px solid var(--royal-gold);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 1.05rem 1.2rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.award-card:hover { background-color: var(--bg-soft); }
.award-icon { color: var(--royal-gold); margin-right: 0.45rem; }
.award-title { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.3rem; line-height: 1.4; }
.award-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); }

/* Experience blocks (research / teaching / industry) */
.exp-block { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.exp-block:first-of-type { border-top: 0; padding-top: 0.2rem; }
.exp-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.exp-role { font-size: 0.98rem; }
.exp-role strong { color: var(--text-primary); }
.exp-place { color: var(--text-muted); margin-left: 0.2rem; font-style: italic; font-family: var(--font-display); }
.exp-dates { white-space: nowrap; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted); }
.exp-text { margin: 0.3rem 0 0; font-size: 0.93rem; color: var(--text-body); max-width: 60ch; }

.teaching-block { padding: 0.95rem 0; border-top: 1px solid var(--rule); }
.teaching-block:first-of-type { border-top: 0; padding-top: 0.2rem; }
.teaching-role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.55rem; margin-bottom: 0.35rem; }
.teaching-place { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }
.teaching-courses { font-size: 0.92rem; color: var(--text-body); margin: 0; }

/* Skills */
.skills-group { margin-bottom: 1.3rem; }
.skills-group:last-child { margin-bottom: 0; }
.skills-group-label {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); display: block; margin-bottom: 0.6rem;
}
.skills-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.skill-chip {
  font-size: 0.83rem; color: var(--text-body); background: var(--bg-elevated);
  border: 1px solid var(--rule); padding: 0.38rem 0.8rem; border-radius: 99px;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.skill-chip:hover { border-color: var(--accent-line); color: var(--accent); background-color: var(--accent-soft); }

/* Footer */
.site-footer {
  margin-top: 3.5rem; padding-top: 1.3rem; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; color: var(--text-faint);
  display: flex; justify-content: center; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  max-width: var(--maxw); margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem;
}
.footer-disclaimer::before { content: "\2022"; margin-right: 0.6rem; color: var(--rule-strong); }

@media (prefers-reduced-motion: no-preference) {
  .hero {
    opacity: 0; transform: translateY(8px);
    animation: reveal 0.6s cubic-bezier(.2,.7,.2,1) forwards;
    animation-delay: 0.02s;
  }
  @keyframes reveal { to { opacity: 1; transform: translateY(0); } }

  /* Scroll-triggered reveal, progressive enhancement only: sections are
     fully visible by default, and only start hidden-until-scrolled-into-view
     once home.js confirms it's running (html.js-ready) — see home.js. */
  html.js-ready .section {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
  }
  html.js-ready .section.in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  opacity: 0.55;
  z-index: 60;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-progress { transition: width 0.15s ease-out; }
}



.section-rail {
  display: none;
}

@media (min-width: 1280px) {
  .section-rail {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: fixed;
    left: clamp(20px, 3.5vw, 56px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
  }

  .section-rail a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    background: none;
    color: var(--text-faint);
    line-height: 1;
  }

  .section-rail .rail-num {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    width: 1.4rem;
    text-align: right;
    flex: none;
  }

  .section-rail .rail-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.25s ease, opacity 0.2s ease;
  }

  .section-rail a:hover .rail-label,
  .section-rail a:focus-visible .rail-label,
  .section-rail a.is-active .rail-label {
    max-width: 140px;
    opacity: 1;
  }

  .section-rail a:hover,
  .section-rail a:focus-visible {
    color: var(--text-muted);
  }

  .section-rail a.is-active {
    color: var(--accent);
  }

  .section-rail a.is-active .rail-num {
    color: var(--accent);
  }
}

@media (min-width: 1280px) and (prefers-reduced-motion: reduce) {
  .section-rail .rail-label { transition: none; }
}

@media (max-width: 640px) {
  .hero { padding: 3rem 0 2rem; text-align: center; }
  .hero-top { grid-template-columns: 1fr; gap: 1.2rem; margin-bottom: 1.8rem; }
  .hero-portrait { align-items: center; }
  .hero-photo { width: 148px; height: 185px; margin: 0 auto; }
  .hero-social { justify-content: center; }
  .hero h1 { font-size: 2.2rem; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero-jump { justify-content: center; }
  .hero-jump a:first-child { padding-left: 0.6rem; }
  .section h2 { font-size: 1.3rem; }
  .pub-item { grid-template-columns: 1fr; gap: 0.35rem; }
  .pub-year { padding-top: 0; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .exp-header { flex-direction: column; gap: 0.2rem; }
  .project-grid, .awards-grid { grid-template-columns: 1fr; }
  .nav-links { font-size: 0.72rem; }
  .header-inner { padding: 0.85rem 1.1rem; }
  .research-groups { grid-template-columns: 1fr; }
  .notebook-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Research identity — typographic groups (no diagram; the
   grouping itself, via mono labels + serif terms, is the
   structure). Sits at the end of the Research section.
   ========================================================= */
.research-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 1.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.research-group-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.research-group-terms {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* =========================================================
   From the Notebook — homepage teaser for the blog. Unnumbered
   on purpose: it is connective/promotional tissue pointing at
   the Notes page, not a core CV-style section, so it sits
   outside the section-rail's numbering.
   ========================================================= */
/* max-width/margin/scroll-margin come from the shared .section
   class also applied on the element -- kept here as a no-op
   comment so the relationship stays obvious when this file grows. */
.notebook-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--rule);
}
.notebook-head h2 { font-size: 1.55rem; letter-spacing: -0.015em; }
.notebook-head .notebook-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.notebook-all-link { font-family: var(--font-mono); font-size: 0.78rem; white-space: nowrap; }

.notebook-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.notebook-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.35rem;
  background-image: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.notebook-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-soft); }
.notebook-card-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}
.notebook-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.notebook-card-desc { font-size: 0.88rem; color: var(--text-body); line-height: 1.55; margin: 0 0 0.8rem; flex: 1; }
.notebook-card-read {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); background: none;
}
.notebook-card:hover .notebook-card-read { color: var(--accent-bright); }
.notebook-card-read i { font-size: 0.7em; transition: transform 0.18s ease; }

/* =========================================================
   Projects — selected work, not a GitHub redirect. Reuses the
   pub-list rhythm (rule-separated rows) rather than inventing a
   new card language, so Projects reads as a sibling of
   Publications rather than an unrelated portfolio grid.
   ========================================================= */
.projects-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.project-row {
  padding: 1.3rem 0.2rem;
  border-top: 1px solid var(--rule);
}
.project-row:first-child { border-top: 0; padding-top: 0.3rem; }
.project-row:last-child { padding-bottom: 0.4rem; }
.project-row-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.project-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text-primary); }
.project-year { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-faint); white-space: nowrap; }
.project-desc-text { font-size: 0.94rem; color: var(--text-body); max-width: 62ch; margin: 0 0 0.7rem; font-style: normal; font-family: var(--font-body); text-align: left; }
.project-tags { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.65rem; }
.project-tags span:not(:last-child)::after { content: " \00b7 "; color: var(--rule-strong); }
.project-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.project-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); background: none;
}
.project-links a:hover { color: var(--accent-bright); }
.projects-more { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--rule); text-align: center; }
.projects-more a { font-family: var(--font-mono); font-size: 0.82rem; }

/* =========================================================
   Background (Education / Research Exp. / Teaching / Industry /
   Skills / Awards) — kept, in full, exactly as authored, but
   consolidated into one compact, de-emphasized section instead
   of six equal-weight ones, with a direct link to the full PDF.
   ========================================================= */
.background-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: -0.4rem 0 0.4rem;
}
.background-intro p { margin: 0; color: var(--text-muted); font-size: 0.92rem; max-width: 46ch; }
.background-cv-link {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-primary);
  background: var(--bg-elevated); border: 1px solid var(--rule-strong);
  padding: 0.5rem 0.95rem; border-radius: var(--radius); background-image: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.background-cv-link:hover { background-color: var(--accent); border-color: var(--accent); color: var(--bg-elevated); }

.background-block { margin-top: 2.2rem; }
.background-block:first-of-type { margin-top: 0; }

@media (max-width: 640px) {
  .research-groups { grid-template-columns: 1fr; gap: 1.1rem; }
  .project-row-head { flex-direction: column; gap: 0.15rem; }
  .background-intro { flex-direction: column; align-items: flex-start; }
}


/* Homepage refresh: selected 2026 portfolio changes */
.hero { padding-bottom: 2.4rem; }
.hero-top { margin-bottom: 1.7rem; }
.hero h1 { margin-bottom: 0.35rem; }
.hero-tagline {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--accent);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.25rem; }
.hero-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0.48rem 0.82rem;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--bg-elevated); background-image: none;
  font-family: var(--font-mono); font-size: 0.77rem; color: var(--text-body);
}
.hero-action:hover, .hero-action:focus-visible { border-color: var(--accent-line); color: var(--accent); background-color: var(--accent-soft); }
.hero-action.is-primary { border-color: var(--accent); color: var(--accent); }
.news-strip a { color: var(--text-body); background-image: linear-gradient(var(--accent-line), var(--accent-line)); }
.news-strip a:hover { color: var(--accent); }

.section-thread { max-width: 900px; }
.featured-projects, .interactive-home, .notebook-teaser { max-width: 860px; }
.section-head-link { margin-left: auto; }

.project-featured-row {
  margin-bottom: 0.85rem; padding: 1.2rem 1.25rem;
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.project-featured-row:first-child { padding-top: 1.2rem; border-top: 1px solid var(--accent-line); }
.project-featured-row:last-child { padding-bottom: 1.2rem; }
.project-featured-row:hover { border-color: var(--accent-line); box-shadow: var(--shadow-soft); }
.project-featured-row .project-desc-text { max-width: 72ch; }

.interactive-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.interactive-home-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px dashed var(--accent-line); border-radius: var(--radius-lg);
  background: var(--bg-elevated); background-image: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.interactive-home-card:hover { border-style: solid; border-color: var(--accent); box-shadow: var(--shadow-soft); }
.interactive-home-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--rule); }
.interactive-home-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.interactive-home-kicker { margin: 0.9rem 1rem 0; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.interactive-home-title { margin: 0.35rem 1rem 0; font-family: var(--font-display); font-size: 1.04rem; font-weight: 600; line-height: 1.35; color: var(--text-primary); }
.interactive-home-desc { margin: 0.55rem 1rem 0.8rem; font-size: 0.84rem; line-height: 1.5; color: var(--text-body); flex: 1; }
.interactive-home-cta { margin: 0 1rem 1rem; font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); }
.interactive-home-more { text-align: right; margin-top: 0.9rem !important; }
.interactive-home-more a { font-family: var(--font-mono); font-size: 0.78rem; }

.notebook-grid-three { grid-template-columns: repeat(3, 1fr); }
.notebook-grid-three .notebook-card-title { font-size: 1rem; }
.notebook-grid-three .notebook-card-desc { font-size: 0.84rem; }

.working-papers-note { margin: -0.35rem 0 0.6rem !important; color: var(--text-muted) !important; font-size: 0.86rem !important; }
.working-papers-list { opacity: 0.88; }
.working-papers-list .pub-title { font-size: 0.96rem; }

@media (max-width: 820px) {
  .interactive-home-grid, .notebook-grid-three { grid-template-columns: 1fr; }
  .interactive-home-card { display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto auto 1fr auto; column-gap: 0; }
  .interactive-home-thumb { grid-row: 1 / 5; grid-column: 1; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--rule); }
  .interactive-home-kicker, .interactive-home-title, .interactive-home-desc, .interactive-home-cta { grid-column: 2; }
}
@media (max-width: 560px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-action { width: 100%; }
  .interactive-home-card { display: flex; }
  .interactive-home-thumb { aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--rule); }
}
