:root {
  --accent: #1565c0;
  --accent-hover: #0d47a1;
  --text: #313131;
  --muted: rgba(0, 0, 0, 0.54);
  --nav-text: #34495e;
  --line: #e9ecef;
  --alt: #f7f7f7;
  --white: #ffffff;
  --nav-height: 70px;
  --max-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  margin: 0;
  padding-top: var(--nav-height);
  color: var(--text);
  background: var(--white);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 1rem;
  margin-bottom: .5rem;
  color: #313131;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  line-height: 1.25;
  overflow-wrap: break-word;
}

p { margin-top: 0; margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: var(--accent-hover); text-decoration: underline; }
img { display: block; max-width: 100%; }
strong { font-weight: 700; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 8px 12px;
  color: #fff;
  background: #111;
  border-radius: 3px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-height);
}

.navbar {
  height: 100%;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  backdrop-filter: saturate(180%) blur(10px);
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.navbar-brand {
  flex: 0 0 auto;
  color: #2b2b2b;
  font-family: "Montserrat", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.015em;
  text-decoration: none;
}
.navbar-brand:hover { color: var(--accent); text-decoration: none; }

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.site-nav a {
  position: relative;
  padding: 23px 10px 21px;
  color: var(--nav-text);
  font-size: .95rem;
  font-weight: 400;
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 14px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .16s ease;
}
.site-nav a:hover, .site-nav a:focus, .site-nav a.active {
  color: var(--accent);
  text-decoration: none;
}
.site-nav a.active {
  background: rgba(21, 101, 192, 0.08);
  border-radius: 6px;
}
.site-nav a.active::after { transform: scaleX(1); }

.navbar-toggle {
  display: none;
  width: 42px;
  height: 38px;
  margin-left: auto;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.navbar-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--nav-text);
}

.home-section {
  position: relative;
  padding: 88px 0;
  background: var(--white);
  scroll-margin-top: calc(var(--nav-height) + 16px);
}
.home-section.alt-section { background: var(--alt); }
.about-section { padding: 30px 0 56px; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr);
  gap: 58px;
  align-items: center;
}

#profile {
  position: relative;
  padding: 30px 10px;
  text-align: center;
}

.avatar {
  width: 270px;
  height: 270px;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.portrait-title h1 {
  margin: 20px 0 10px;
  color: #000;
  font-size: 1.75rem;
  font-weight: 300;
}
.portrait-title p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.45;
}

.network-icon {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.network-icon li { margin: 0; transition: transform .15s ease; }
.network-icon li:hover { transform: scale(1.15); }
.network-icon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #2f2f2f;
}
.network-icon a:hover { color: var(--accent); text-decoration: none; }
.network-icon svg { width: 27px; height: 27px; fill: currentColor; }
.network-icon a img { width: 23px; height: 23px; object-fit: contain; }

.article-style {
  font-size: 1rem;
  line-height: 1.72;
}
.about-copy { font-size: 1.02rem; }
.about-copy p:last-child, .article-style p:last-child { margin-bottom: 0; }

.education-list {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}
.education-list li {
  margin: 0.5rem 0;
  padding-left: 1.8rem;
  position: relative;
}
.education-list li::before {
  content: "🎓";
  position: absolute;
  left: 0;
  top: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 2.25fr);
  gap: 58px;
  align-items: start;
}
.section-heading h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 400;
}
.section-content > :first-child { margin-top: 0; }
.section-content > :last-child { margin-bottom: 0; }

.btn {
  display: inline-block;
  margin: 4px 2px 0;
  padding: 3px 8px;
  border: 1px solid #000;
  border-radius: 4px;
  color: #000;
  background: #fff;
  font-size: .82rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover, .btn:focus {
  color: #000;
  background: #f3f3f3;
  border-color: #000;
  text-decoration: none;
  transform: translateY(-1px);
}

.publication-content h3, .teaching-content h3 {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 500;
}
.publication-content h3:not(:first-child), .teaching-content h3:not(:first-child) { margin-top: 38px; }
.publication-list {
  margin: 0;
  padding-left: 1.35rem;
}
.publication-list li {
  margin-bottom: 1.15rem;
  padding-left: .4rem;
  line-height: 1.62;
}
.publication-list li::marker { color: #777; font-weight: 500; }

.teaching-content ul { padding-left: 1.25rem; }
.teaching-content li { margin-bottom: .35rem; }

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 22px;
  padding: 0 0 20px 24px;
  border-left: 2px solid #d9e2ef;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 5px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.alt-section .timeline li::before { border-color: var(--alt); }
.timeline li:last-child { padding-bottom: 0; }
.timeline time {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}
.timeline span { line-height: 1.55; }

.site-footer {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #777;
  font-size: .9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.footer-inner p { margin: 0; }

@media (max-width: 1020px) {
  :root { --nav-height: 58px; }
  .navbar-brand { font-size: 1rem; }
  .navbar-toggle { display: block; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--nav-height);
    display: none;
    margin: 0;
    padding: 8px 18px 14px;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 7px 16px rgba(0, 0, 0, .08);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 4px; }
  .site-nav a::after { display: none; }
}

@media (max-width: 800px) {
  .home-section { padding: 60px 0; }
  .about-section { padding-top: 38px; }
  .about-grid, .section-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  #profile { padding: 0 10px 18px; }
  .avatar { width: 200px; height: 200px; }
  .about-copy { font-size: 1rem; }
  .section-heading h2 { font-size: 1.8rem; }
  .section-heading { text-align: center; }
  .timeline li { grid-template-columns: 104px 1fr; gap: 14px; }
}

@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .container { padding: 0 18px; }
  .navbar-brand { max-width: calc(100% - 58px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portrait-title h1 { font-size: 1.55rem; }
  .timeline li { grid-template-columns: 1fr; gap: 3px; padding-left: 19px; }
  .timeline time { font-size: .86rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Experience — card/timeline treatment inspired by the reference site's Experience section. */
.experience-list {
  display: flex;
  flex-direction: column;
}

.experience-entry {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.experience-track {
  position: relative;
  min-height: 100%;
}
.experience-track::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #d9dee5;
}
.experience-entry:first-child .experience-track::before { top: 32px; }
.experience-entry:last-child .experience-track::before { bottom: calc(100% - 32px); }

.experience-dot {
  position: absolute;
  z-index: 1;
  top: 30px;
  left: 9px;
  width: 12px;
  height: 12px;
  border: 1px solid #adb5bd;
  border-radius: 60%;
  background: var(--white);
  box-shadow: 0 0 0 3px var(--white);
}
.experience-entry.current .experience-dot {
  border-color: var(--accent);
  background: var(--accent);
  width: 20px;
  height: 20px;
  left: 4px;
}

.experience-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 8px 0;
  padding: 18px 20px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .055);
  transition: box-shadow .15s ease, transform .15s ease;
}
.experience-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}

.experience-logo-link {
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
}
.experience-logo-link:hover,
.experience-logo-link:focus { text-decoration: none; }
.experience-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.experience-details h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}
.experience-company {
  margin: 0 0 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}
.experience-meta {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}
.middot-divider::after {
  content: "\00B7";
  margin: 0 .5rem;
}

@media (max-width: 575px) {
  .experience-entry {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .experience-track { display: none; }
  .experience-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 12px;
    padding: 15px 14px;
  }
  .experience-logo-link,
  .experience-logo {
    width: 46px;
    height: 46px;
  }
  .experience-details h3 { font-size: 1rem; }
  .experience-company { font-size: .96rem; }
  .experience-meta { font-size: .86rem; }
}
