:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #edf1f6;
  --text: #132033;
  --muted: #5d6877;
  --line: #dce2ea;
  --primary: #123b5d;
  --primary-strong: #0b2d49;
  --accent: #2b7a78;
  --shadow: 0 20px 60px rgba(19, 32, 51, 0.10);
  --radius: 22px;
  --container: 1160px;
}

html[data-theme="dark"] {
  --bg: #0c1420;
  --surface: #121e2d;
  --surface-alt: #162435;
  --text: #edf3f8;
  --muted: #a8b5c4;
  --line: #29394c;
  --primary: #78b7dd;
  --primary-strong: #9ccbe7;
  --accent: #77c7c1;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: inherit; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; }

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 999;
  padding: .75rem 1rem;
  background: var(--surface);
  border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--primary-strong), var(--accent));
  letter-spacing: -.04em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.main-nav a {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 650;
  color: var(--muted);
}
.main-nav a:hover, .main-nav a:focus { color: var(--primary); }

.theme-toggle, .nav-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.hero {
  padding: 7rem 0 5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 28rem),
    radial-gradient(circle at 15% 70%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 30rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .8fr);
  gap: 5rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .78rem;
  font-weight: 800;
}

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -.035em;
}
h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(3rem, 8vw, 6.8rem);
}
h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}
h3 {
  margin: 0 0 .7rem;
  font-size: 1.25rem;
}

.lead {
  max-width: 760px;
  margin: 1.6rem 0 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .75rem 1.2rem;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  border: 1px solid transparent;
}
.button.primary { background: var(--primary); color: var(--bg); }
html:not([data-theme="dark"]) .button.primary { color: #fff; }
.button.primary:hover { background: var(--primary-strong); }
.button.secondary { background: var(--surface); border-color: var(--line); }
.button.secondary:hover { border-color: var(--primary); }

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
  list-style: none;
  margin: 1.7rem 0 0;
  padding: 0;
}
.quick-links a {
  color: var(--muted);
  text-underline-offset: .25rem;
  font-size: .95rem;
}
.hero-profile {
  max-width: 340px;
}

.profile-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  display: block;
}

.profile-info {
  margin-top: 1.4rem;
}

.profile-info h2 {
  margin-bottom: .5rem;
  font-size: 1.45rem;
}

.profile-info p {
  margin: .3rem 0;
  color: var(--muted);
}

.profile-info .small {
  font-size: .9rem;
}

.section { padding: 6rem 0; }
.section-alt { background: var(--surface-alt); }
.intro-strip { padding: 1.6rem 0; border-block: 1px solid var(--line); }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
}
.chips span {
  padding: .55rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .92rem;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2.6rem;
}
.section-heading > p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }
.split-heading {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}
.text-link { color: var(--primary); font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.card-grid {
  display: grid;
  gap: 1.25rem;
}
.three-columns { grid-template-columns: repeat(3, 1fr); }
.two-columns { grid-template-columns: repeat(2, 1fr); }

.card, .project-card, .news-card {
  padding: 1.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card p, .project-card p, .news-card p { color: var(--muted); }
.card-number {
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--accent);
  font-weight: 800;
  font-size: .85rem;
}

.publication-list { border-top: 1px solid var(--line); }
.publication {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.publication p { margin: .35rem 0 0; color: var(--muted); }
.pub-year { color: var(--accent); font-size: 1.15rem; font-weight: 800; }
.pub-meta { font-size: .92rem; }

.project-card {
  min-height: 340px;
  padding: 1.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);

  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
}
.project-card.featured {
  color: white;
  background: linear-gradient(145deg, var(--primary-strong), #1b5d7a);
  border: none;
}
.project-card.featured p { color: rgba(255,255,255,.78); }
.project-type {
  margin: 0 0 .5rem;
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .11em;
  font-weight: 800;
}
.project-card h3 { font-size: 2.2rem; }
.project-subtitle { font-weight: 700; }

.teaching-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 5rem;
}
.timeline { border-left: 1px solid var(--line); padding-left: 2rem; }
.timeline article { position: relative; padding: 0 0 2.3rem; }
.timeline article:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: calc(-2rem - 7px);
  top: .4rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--surface-alt);
}
.timeline-label { margin: 0 0 .35rem; color: var(--accent); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .11em; }
.timeline p:last-child { color: var(--muted); }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.news-card time { color: var(--accent); font-size: .85rem; font-weight: 800; }
.news-card h3 { margin-top: 1.2rem; }

.contact-section {
  background: linear-gradient(145deg, var(--primary-strong), #123b5d);
  color: white;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 4rem;
  align-items: center;
}
.contact-section .eyebrow { color: #8ed6d1; }
.contact-section p { color: rgba(255,255,255,.78); }
.contact-card {
  padding: 2rem;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
}
.contact-card a { color: white; font-weight: 750; }

.site-footer { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .88rem; }
.footer-inner p { margin: 0; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 3px; }

@media (max-width: 900px) {
  .hero { padding-top: 5rem; }
  .hero-grid, .teaching-grid, .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-grid { max-width: 760px; }
  .profile-card { max-width: 460px; }
  .three-columns, .news-grid { grid-template-columns: 1fr; }
  .two-columns { grid-template-columns: 1fr; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .research-grid {
  grid-template-columns: 1fr;}
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    inset: 76px 1rem auto 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .5rem; }
  .theme-toggle { align-self: flex-start; }
}

.research-grid {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 1.5rem;
}

.research-card {
  padding: 1.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.research-card > p {
  color: var(--muted);
}

.traffic-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.8rem;
}

.simulation h4 {
  margin: 0 0 .6rem;
  text-align: center;
  font-size: .95rem;
}

.simulation video,
.ants-video video {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.tfc {
  margin: .7rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

.tfc strong {
  color: var(--text);
  font-size: 1.15rem;
}

.ants-video {
  margin-top: 1.8rem;
}

@media (max-width: 620px) {
  .section { padding: 4.2rem 0; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .brand-text { display: none; }
  .publication { grid-template-columns: 1fr; gap: .5rem; }
  .footer-inner { flex-direction: column; }

  .traffic-comparison {
    grid-template-columns: 1fr;
  }
}
.publication-group {
  margin-top: 3rem;
}

.publication-category {
  margin-bottom: 1.5rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.6rem;
}

.publication-items {
  margin: 0;
  padding-left: 1.5rem;
}

.publication-items li {
  padding: .8rem 0 .8rem .5rem;
  color: var(--muted);
}

.publication-items strong {
  color: var(--text);
  font-weight: 700;
}

.publication-items em {
  color: var(--text);
}
.academic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.academic-block {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.academic-subsection {
  margin-top: 1.4rem;
}

.academic-subsection h3 {
  margin-bottom: .4rem;
}

.academic-subsection p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .academic-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

