:root {
  --background: #f6f8fa;
  --surface: #ebf0f5;
  --surface-strong: #dde5ed;
  --text: #1e2933;
  --muted: #64717e;
  --forest: #19344f;
  --forest-light: #496a89;
  --ocean: #376f9e;
  --ocean-dark: #29577e;
  --border: #d2dce5;
  --redwood: #986044;
  --shadow: 0 16px 38px rgba(25, 52, 79, 0.15);
}


/* -------------------------------------------------- */
/* Global                                             */
/* -------------------------------------------------- */

* {
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;
  background: var(--background);
  color: var(--text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;

  font-size: 1rem;
  line-height: 1.7;

  text-rendering: optimizeLegibility;
}


a {
  color: var(--ocean);
  text-decoration: none;
  text-underline-offset: 0.2em;

  transition:
    color 160ms ease,
    text-decoration-color 160ms ease;
}


a:hover {
  color: var(--forest);

  text-decoration: underline;
  text-decoration-thickness: 1px;
}


a:focus-visible {
  border-radius: 2px;

  outline: 3px solid rgba(53, 109, 130, 0.28);
  outline-offset: 4px;
}


/* -------------------------------------------------- */
/* Accessibility                                      */
/* -------------------------------------------------- */

.skip-link {
  position: fixed;

  top: 12px;
  left: 12px;

  z-index: 200;

  padding: 8px 12px;

  border-radius: 6px;

  background: var(--forest);
  color: #fff;

  transform: translateY(-150%);
}


.skip-link:focus {
  transform: translateY(0);
}


/* -------------------------------------------------- */
/* Top navigation                                     */
/* -------------------------------------------------- */

.site-header {
  position: sticky;

  top: 0;

  z-index: 100;

  border-bottom: 1px solid var(--border);

  background: rgba(246, 248, 250, 0.96);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}


.section-nav {
  display: flex;

  width: min(100% - 44px, 880px);

  margin: 0 auto;

  gap: 24px;

  overflow-x: auto;

  scrollbar-width: none;
}


.section-nav::-webkit-scrollbar {
  display: none;
}


.section-nav a {
  flex: 0 0 auto;

  padding: 13px 0;

  color: var(--forest-light);

  font-size: 0.88rem;
  font-weight: 650;

  white-space: nowrap;
}


.section-nav a:hover {
  color: var(--forest);
}


/* -------------------------------------------------- */
/* Main layout                                        */
/* -------------------------------------------------- */

main {
  width: min(100% - 44px, 880px);

  margin: 0 auto;

  padding: 62px 0 42px;
}


.intro {
  display: grid;

  grid-template-columns: minmax(0, 1fr) 230px;

  align-items: center;

  gap: 56px;

  margin-bottom: 84px;

  scroll-margin-top: 72px;
}


h1,
h2,
h3,
p {
  margin-top: 0;
}


h1 {
  margin-bottom: 10px;

  color: var(--forest);

  font-size: clamp(2.35rem, 6vw, 3rem);
  font-weight: 730;

  letter-spacing: -0.045em;

  line-height: 1.02;
}


.subtitle {
  margin-bottom: 18px;

  color: var(--ocean-dark);

  font-size: 1.08rem;
  font-weight: 600;
}


.intro-description {
  max-width: 590px;

  margin-bottom: 0;
}


.profile-links {
  display: flex;

  flex-wrap: wrap;

  gap: 9px 21px;

  margin-top: 23px;
}


.profile-links a,
.paper-links a {
  font-weight: 650;
}


/* -------------------------------------------------- */
/* Portrait                                           */
/* -------------------------------------------------- */

.portrait-frame {
  width: 230px;
  height: 300px;

  padding: 5px;

  border-radius: 18px;

  background: var(--surface-strong);

  box-shadow: var(--shadow);
}


.portrait-frame img {
  display: block;

  width: 100%;
  height: 100%;

  border-radius: 13px;

  object-fit: cover;
}


/* -------------------------------------------------- */
/* Sections                                           */
/* -------------------------------------------------- */

section {
  margin-bottom: 62px;

  scroll-margin-top: 72px;
}


section > h2 {
  margin-bottom: 25px;

  padding-bottom: 8px;

  border-bottom: 1px solid var(--border);

  color: var(--forest);

  font-size: 1.38rem;

  letter-spacing: -0.02em;

  line-height: 1.3;
}


/* -------------------------------------------------- */
/* Timeline                                           */
/* -------------------------------------------------- */

.timeline-item {
  margin-bottom: 27px;
}


.timeline-item:last-child,
.publication:last-child {
  margin-bottom: 0;
}


.item-heading {
  display: flex;

  align-items: baseline;

  justify-content: space-between;

  gap: 24px;
}


.item-heading strong {
  color: var(--forest);
}


/*
  Only direct child spans are dates.
  This keeps inline locations and student counts
  separate from the date styling.
*/

.item-heading > span {
  flex: 0 0 auto;

  color: var(--muted);

  font-size: 0.93rem;

  white-space: nowrap;
}


.timeline-item p {
  margin: 4px 0 0;

  color: var(--muted);
}


/* -------------------------------------------------- */
/* Inline metadata                                    */
/* -------------------------------------------------- */

.inline-location,
.student-count {
  color: var(--muted);

  font-size: 0.93rem;

  font-weight: 400;

  white-space: normal;
}


/* Link from Experience to Teaching */

.experience-section-link {
  color: var(--forest);

  text-decoration: none;
}


.experience-section-link:hover {
  color: var(--ocean);

  text-decoration: underline;

  text-decoration-thickness: 1px;
}


/* -------------------------------------------------- */
/* Compact timeline spacing                           */
/* -------------------------------------------------- */

#education > h2,
#experience > h2,
#awards > h2,
#teaching > h2 {
  margin-bottom: 12px;
}


#education .timeline-item,
#awards .timeline-item,
#teaching .timeline-item {
  margin-bottom: 12px;
}

#experience .timeline-item {
  margin-bottom: 24px;
}


#education .timeline-item p,
#awards .timeline-item p,
#teaching .timeline-item p {
  margin-top: 4px;

  color: var(--muted);

  font-size: 0.93rem;

  line-height: 1.45;
}


.timeline-item .item-bullets {
  margin: 8px 0 0;

  padding-left: 20px;

  color: var(--muted);
}

.timeline-item .item-bullets li {
  margin-bottom: 6px;

  line-height: 1.55;

  font-size: 0.94rem;
}

.timeline-item .item-bullets li:last-child {
  margin-bottom: 0;
}

.timeline-item .item-description {
  margin-top: 4px;

  color: var(--muted);

  font-size: 0.94rem;

  line-height: 1.5;
}



/* -------------------------------------------------- */
/* Connected sub-timeline (LinkedIn-style roadmap)   */
/* -------------------------------------------------- */

.sub-timeline {
  position: relative;

  margin: 14px 0 0 8px;

  padding-left: 22px;

  border-left: 2px solid var(--border);
}

.sub-timeline-item {
  position: relative;

  margin-bottom: 18px;
}

.sub-timeline-item:last-child {
  margin-bottom: 0;
}

.sub-timeline-item::before {
  position: absolute;

  top: 5px;

  left: -28px;

  width: 10px;

  height: 10px;

  border: 2px solid var(--ocean);

  border-radius: 50%;

  background: var(--background);

  content: "";
}

.sub-timeline-item .sub-heading {
  display: flex;

  align-items: baseline;

  justify-content: space-between;

  gap: 16px;

  margin-bottom: 4px;
}

.sub-timeline-item .sub-heading strong {
  color: var(--forest);

  font-size: 0.95rem;
}

.sub-timeline-item .sub-heading span {
  color: var(--muted);

  font-size: 0.88rem;

  white-space: nowrap;
}

.sub-timeline-item ul {
  margin: 4px 0 0;

  padding-left: 18px;

  color: var(--muted);

  font-size: 0.92rem;
}

.sub-timeline-item ul li {
  margin-bottom: 4px;

  line-height: 1.5;
}

.sub-timeline-item ul li:last-child {
  margin-bottom: 0;
}



/* -------------------------------------------------- */
/* Publications and patents                           */
/* -------------------------------------------------- */

.year-heading {
  margin: 32px 0 18px;

  color: var(--forest-light);

  font-size: 0.9rem;
  font-weight: 750;

  letter-spacing: 0.08em;
}


#publications > .year-heading:first-of-type,
#patents > .year-heading:first-of-type {
  margin-top: 0;
}


.publication {
  margin-bottom: 29px;
}


.publication h3 {
  margin-bottom: 4px;

  color: var(--text);

  font-size: 1rem;

  line-height: 1.5;
}


.publication p {
  margin-bottom: 2px;
}


.authors {
  color: var(--muted);
}


.my-name {
  color: inherit;

  font-weight: inherit;

  text-decoration: underline;

  text-decoration-color: var(--ocean);

  text-decoration-thickness: 1.5px;

  text-underline-offset: 3px;
}


.venue {
  color: var(--redwood);

  font-style: italic;
}


.publication-meta {
  color: var(--muted);

  font-size: 0.93rem;
}


.publication-award {
  margin: 6px 0 4px;
}


.publication-award a {
  display: inline-block;

  padding: 3px 10px;

  border-radius: 6px;

  background: var(--redwood);

  color: #ffffff;

  font-size: 0.86rem;

  font-style: normal;

  font-weight: 700;

  letter-spacing: 0.01em;

  text-decoration: none;
}


.publication-award a:hover {
  background: var(--forest);

  color: #ffffff;

  text-decoration: none;
}


.paper-links {
  display: flex;

  flex-wrap: wrap;

  gap: 14px;

  margin-top: 5px;

  font-size: 0.9rem;
}


/* -------------------------------------------------- */
/* Compact publication spacing                        */
/* -------------------------------------------------- */

#publications > h2 {
  margin-bottom: 12px;
}


#publications .year-heading {
  margin-top: 20px;

  margin-bottom: 10px;
}


#publications > .year-heading:first-of-type {
  margin-top: 0;
}


#publications .publication {
  margin-bottom: 16px;
}


#publications .publication p {
  margin-bottom: 0;
}


#publications .paper-links {
  margin-top: 3px;
}


/* -------------------------------------------------- */
/* Highlighted award                                  */
/* -------------------------------------------------- */

#awards .featured-award {
  padding: 8px 12px;

  border-left: 3px solid var(--redwood);

  border-radius: 0 8px 8px 0;

  background: var(--surface);
}


#awards .featured-award strong {
  color: var(--redwood);
}


/* -------------------------------------------------- */
/* Skills                                             */
/* -------------------------------------------------- */

#skills > h2 {
  margin-bottom: 20px;
}

.skills-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.skill-category {
  padding: 18px 20px;

  border: 1px solid var(--border);

  border-radius: 12px;

  background: var(--surface);
}

.skill-category h3 {
  margin-bottom: 8px;

  color: var(--forest);

  font-size: 0.98rem;

  font-weight: 700;
}

.skill-category p {
  margin: 0;

  color: var(--muted);

  font-size: 0.92rem;

  line-height: 1.6;
}


/* -------------------------------------------------- */
/* Professional service                               */
/* -------------------------------------------------- */


.service-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 19px;
}


.service-group {
  padding: 20px 22px;

  border: 1px solid var(--border);

  border-radius: 12px;

  background: var(--surface);
}


.service-group h3 {
  margin-bottom: 11px;

  color: var(--forest);

  font-size: 0.97rem;
}


.service-group ul {
  margin: 0;

  padding: 0;

  list-style: none;
}


.service-group li {
  position: relative;

  margin: 6px 0;

  padding-left: 15px;

  color: var(--muted);
}


.service-group li::before {
  position: absolute;

  top: 0.68em;

  left: 0;

  width: 4px;
  height: 4px;

  border-radius: 50%;

  background: var(--forest-light);

  content: "";
}


/* -------------------------------------------------- */
/* Footer                                             */
/* -------------------------------------------------- */

footer {
  margin-top: 76px;

  padding-top: 22px;

  border-top: 1px solid var(--border);

  color: var(--muted);

  font-size: 0.86rem;
}


footer p {
  margin-bottom: 0;
}


/* -------------------------------------------------- */
/* Mobile                                             */
/* -------------------------------------------------- */

@media (max-width: 720px) {

  .section-nav {
    width: 100%;

    gap: 18px;

    padding: 0 19px;
  }


  .section-nav a {
    padding: 11px 0;

    font-size: 0.84rem;
  }


  main {
    width: min(100% - 38px, 880px);

    padding-top: 40px;
  }


  .intro {
    grid-template-columns: 1fr;

    gap: 34px;

    margin-bottom: 68px;
  }


  .portrait-frame {
    grid-row: 1;

    width: 185px;
    height: 238px;
  }


  .skills-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }


  .item-heading,
  .sub-timeline-item .sub-heading {
    display: block;
  }


  /*
    Only dates move to the next line on mobile.
  */

  .item-heading > span {
    display: block;

    margin-top: 2px;

    white-space: normal;
  }


  /*
    Locations and student counts remain inline
    with the corresponding title.
  */

  .inline-location,
  .student-count {
    display: inline;

    margin-top: 0;

    white-space: normal;
  }

}


/* -------------------------------------------------- */
/* Reduced motion                                     */
/* -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }


  * {
    transition: none !important;
  }

}


/* -------------------------------------------------- */
/* Printing                                           */
/* -------------------------------------------------- */

@media print {

  :root {
    --background: #fff;
  }


  body {
    color: #111;
  }


  main {
    width: 100%;

    padding: 0;
  }


  .skip-link,
  .site-header,
  .portrait-frame,
  .paper-links {
    display: none;
  }


  .intro {
    display: block;

    margin-bottom: 36px;
  }


  section {
    margin-bottom: 34px;
  }


  article,
  .service-group {
    break-inside: avoid;
  }


  a {
    color: inherit;
  }

}