:root {
  --navy: #0c2340;
  --orange: #dd550c;
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #e3e6ec;
  --bg: #ffffff;
  --soft: #f5f6f8;
  --max: 920px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--navy); text-decoration-color: rgba(12,35,64,.35); text-underline-offset: 2px; }
a:hover { color: var(--orange); text-decoration-color: currentColor; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; color: var(--navy); line-height: 1.25; }
h1 { font-size: 2.1rem; margin: 0 0 .25rem; }
h2 { font-size: 1.45rem; margin: 2.4rem 0 .8rem; padding-bottom: .35rem; border-bottom: 2px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .3rem; }
p { margin: 0 0 1rem; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: .8rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 1.15rem; color: var(--navy); text-decoration: none; }
.brand:hover { color: var(--navy); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.3rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; padding: .2rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--orange); }

main { max-width: var(--max); margin: 0 auto; padding: 2.2rem 16px 3rem; }

/* home hero */
.hero { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.hero .role { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.2rem; }
.lede { font-size: 1.15rem; }
.contact-line { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .95rem; color: var(--muted); margin-top: .4rem; }
.contact-line a { font-weight: 600; }

/* cards */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { background: var(--soft); border-radius: 8px; padding: 1.1rem 1.2rem; border-top: 3px solid var(--orange); }
.card h3 { margin-top: 0; }
.card p { margin: 0; font-size: .97rem; color: var(--ink); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0 .5rem; }
.stat { border-left: 3px solid var(--navy); padding: .2rem 0 .2rem .8rem; }
.stat b { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.stat span { font-size: .9rem; color: var(--muted); }

/* lists */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.news time { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.entries .meta { color: var(--muted); font-size: .93rem; }
.pubs { padding-left: 1.4rem; margin: 0; }
.pubs li { margin-bottom: .8rem; }
.pubs .venue { font-style: italic; }
.pubs .award { display: inline-block; margin-top: .2rem; font-size: .85rem; font-weight: 600; color: var(--orange); }
.me { font-weight: 600; }

figure { margin: 1.2rem 0; }
figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }

.button { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; padding: .55rem 1rem; border-radius: 6px; font-weight: 600; }
.button:hover { background: var(--orange); color: #fff; }
.cv-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 8px; margin-top: 1rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 1.2rem 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.75rem; }
  .news li { grid-template-columns: 1fr; gap: .1rem; }
  nav ul { gap: .9rem; }
  .courses th:nth-child(3), .courses td:nth-child(3) { display: none; }
  table { font-size: .9rem; }
}

/* ---- banner (from the old site's road-network header) ---- */
.banner { background: #0b1220 url("assets/img/banner-network.jpg") center/cover no-repeat; position: relative; }
.banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,35,64,.85), rgba(12,35,64,.35)); }
.banner .inner { position: relative; max-width: var(--max); margin: 0 auto; padding: 3.2rem 16px 2.6rem; }
.banner h1 { color: #fff; margin: 0; font-size: 2.3rem; }
.banner h1::after { content: ""; display: block; width: 56px; height: 3px; background: var(--orange); margin-top: .7rem; }

/* ---- about intro ---- */
.intro { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
.intro-photo img { width: 100%; height: auto; border-radius: 10px; display: block; }
.intro .name { margin: 0 0 .2rem; border: 0; padding: 0; font-size: 1.8rem; }
.intro .role { color: var(--muted); margin-bottom: 1rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.button.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: calc(.55rem - 2px) calc(1rem - 2px); }
.button.ghost:hover { background: var(--navy); color: #fff; }

/* ---- image tiles (skills, philosophy) ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.tile { background: var(--soft); border-radius: 10px; overflow: hidden; }
.tile img { width: 100%; height: 170px; object-fit: cover; display: block; }
.tile h3 { margin: .9rem 1rem .3rem; }
.tile p, .tile ul { margin: 0 1rem 1rem; font-size: .96rem; }
.tile ul { padding-left: 1.1rem; }

/* ---- projects with side image ---- */
.project { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.6rem; align-items: start; margin: 1.2rem 0 1.6rem; }
.project h3 { margin-top: .2rem; }
.project .meta { color: var(--muted); font-size: .93rem; margin-bottom: .6rem; }
.project-img figure { margin: 0 0 .8rem; }
.project-img img { box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }

/* ---- gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.gallery a { display: block; border-radius: 6px; overflow: hidden; }
.gallery img { width: 100%; height: 170px; object-fit: cover; display: block; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }

/* ---- embeds ---- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.map { width: 100%; height: 280px; border: 0; border-radius: 8px; }
.doc-frame { width: 100%; height: 85vh; border: 1px solid var(--line); border-radius: 8px; }
.video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
.caption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

@media (max-width: 720px) {
  .intro { grid-template-columns: 1fr; }
  .intro-photo { max-width: 240px; }
  .project, .duo, .contact { grid-template-columns: 1fr; }
  .banner h1 { font-size: 1.8rem; }
  .banner .inner { padding: 2.2rem 16px 1.8rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery img { height: 130px; }
}
figure.narrow { max-width: 640px; }

/* ---- v3 layout tidy ---- */
/* skills as chips */
.tiles.skills .tile img { height: 130px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 1rem 1.1rem; }
.chips span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .15rem .65rem; font-size: .86rem; color: var(--ink); white-space: nowrap; }

/* research areas */
.areas2 { margin-top: .4rem; }
.area { background: var(--soft); border-radius: 10px; padding: 1rem 1.2rem; border-top: 3px solid var(--orange); }
.area h3 { margin-top: .2rem; }
.area p { margin: 0; font-size: .97rem; }
.area-wide { margin: 1rem 0 1.2rem; }
.area-wide .project-img figure { margin: 0; }

/* funded projects */
.grants { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grant { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; background: #fff; }
.grant .amt { font-family: "Source Serif 4", Georgia, serif; font-size: 1.45rem; color: var(--orange); font-weight: 600; line-height: 1.2; margin-bottom: .3rem; }
.grant strong { display: block; color: var(--navy); line-height: 1.35; margin-bottom: .4rem; }
.grant .meta { color: var(--muted); font-size: .88rem; }

/* two columns */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.cols2 h2 { margin-top: 2.4rem; }

/* carousel */
.carousel { position: relative; background: #0b1220; border-radius: 10px; overflow: hidden; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { box-shadow: inset 0 0 0 3px var(--orange); }
.slide { flex: 0 0 100%; scroll-snap-align: center; height: 480px; display: flex; align-items: center; justify-content: center; }
.slide img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); color: var(--navy); font-size: 1.9rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding-bottom: 4px; }
.nav:hover { background: #fff; color: var(--orange); }
.nav.prev { left: 12px; } .nav.next { right: 12px; }
.count { position: absolute; right: 12px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: .82rem; padding: .1rem .55rem; border-radius: 999px; }
.thumbs { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 0 .2rem; }
.thumb { flex: 0 0 auto; border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; cursor: pointer; opacity: .6; }
.thumb img { width: 76px; height: 54px; object-fit: cover; border-radius: 4px; display: block; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--orange); }

/* even photo pairs */
.duo.even img { height: 300px; object-fit: cover; }

@media (max-width: 720px) {
  .cols2 { grid-template-columns: 1fr; gap: 0; }
  .slide { height: 300px; }
  .nav { width: 36px; height: 36px; font-size: 1.5rem; }
  .duo.even img { height: 240px; }
}

/* merged teaching page */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: .6rem; }
.cols3 h3 { margin-top: .6rem; }
.cols3 p { font-size: .97rem; }
details.doc { margin: .4rem 0 1rem; border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
details.doc summary { cursor: pointer; font-weight: 600; color: var(--navy); }
details.doc[open] summary { margin-bottom: .8rem; }
[id] { scroll-margin-top: 70px; }
@media (max-width: 720px) { .cols3 { grid-template-columns: 1fr; gap: 0; } }

/* research projects as expandable rows */
.hint { color: var(--muted); font-size: .92rem; margin-top: -.3rem; }
details.proj { border: 1px solid var(--line); border-radius: 10px; margin: .7rem 0; background: #fff; transition: box-shadow .15s; }
details.proj:hover { box-shadow: 0 2px 8px rgba(12,35,64,.08); }
details.proj > summary { list-style: none; cursor: pointer; padding: .9rem 3rem .9rem 1.1rem; position: relative; display: flex; flex-direction: column; gap: .15rem; }
details.proj > summary::-webkit-details-marker { display: none; }
details.proj > summary::after { content: ""; position: absolute; right: 1.2rem; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
details.proj[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
details.proj > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 10px; }
.proj-title { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; color: var(--navy); font-size: 1.08rem; }
.proj-meta { color: var(--muted); font-size: .9rem; }
details.proj .project { margin: 0; padding: .2rem 1.1rem 1.1rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* project status badges */
details.proj > summary { padding-right: 7.5rem; }
.badge { position: absolute; right: 2.9rem; top: 50%; transform: translateY(-50%); font-size: .74rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: .12rem .55rem; border-radius: 999px; }
.badge.current { background: #fdeee5; color: #b2440a; }
.badge.completed { background: var(--soft); color: var(--muted); }
.project.single { grid-template-columns: 1fr; }
@media (max-width: 720px) {
  details.proj > summary { padding-right: 2.8rem; }
  .badge { position: static; transform: none; align-self: flex-start; margin-top: .3rem; }
}
figure.diagram { margin: .4rem 0 .2rem; }
figure.diagram img { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: none; }
.slide { position: relative; }
.slide-cap { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 100px); background: rgba(0,0,0,.6); color: #fff; font-size: .85rem; line-height: 1.35; padding: .3rem .65rem; border-radius: 6px; }
@media (max-width: 720px) { .slide-cap { font-size: .76rem; left: 8px; bottom: 8px; max-width: calc(100% - 80px); } }
