/* =========================================================
   Academic site — no external fonts or libraries (secure & fast)
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #1b2430;
  --muted: #5a6675;
  --border: #e2e7ee;
  --accent: #1f4e79;       /* structural steel blue */
  --accent-2: #c26a1b;     /* safety orange */
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  --radius: 12px;
  --max: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --bg-alt: #151c24; --text: #e6ebf1; --muted: #9aa7b6;
    --border: #253040; --accent: #7fb3e6; --accent-2: #f0a35e; --card: #18212b;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0f141a; --bg-alt: #151c24; --text: #e6ebf1; --muted: #9aa7b6;
  --border: #253040; --accent: #7fb3e6; --accent-2: #f0a35e; --card: #18212b;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--text); }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: .95rem; }
.nav-menu a:hover, .nav-menu a.active { color: var(--accent); background: var(--bg-alt); text-decoration: none; }
.theme-btn {
  margin-left: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
}
.theme-btn:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .2s; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: center; }
.portrait img {
  width: 220px; height: 220px; object-fit: cover; border-radius: 50%;
  border: 4px solid var(--card); box-shadow: var(--shadow);
}
.eyebrow { color: var(--accent-2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; margin-bottom: .4em; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .2em; }
.affil { color: var(--muted); }
.lead { font-size: 1.05rem; max-width: 62ch; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  border: 1px solid var(--border); color: var(--text); background: var(--card);
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0f141a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0f141a; } }
.btn.primary:hover { filter: brightness(1.1); color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-intro { color: var(--muted); margin-bottom: 28px; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.news li:last-child { border-bottom: 0; }
.news time { color: var(--accent-2); font-weight: 600; font-size: .92rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--bg-alt); margin-bottom: 14px; }
.icon svg { width: 26px; height: 26px; }

/* ---------- Publications ---------- */
.pub-group { font-family: var(--sans); color: var(--accent); text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; margin-top: 28px; }
.pubs { padding-left: 1.6em; margin: 0; }
.pubs li { padding: 14px 0 14px 6px; border-bottom: 1px solid var(--border); }
.pubs li::marker { color: var(--muted); font-size: .9rem; }
.pubs p { margin: 0; }
.pub-title { font-weight: 600; }
.pub-authors, .pub-venue { color: var(--muted); font-size: .95rem; }
.pub-authors strong { color: var(--text); }
.pub-links { margin-top: 6px !important; display: flex; gap: 8px; }
.pub-links a { font-size: .78rem; font-weight: 600; padding: 2px 10px; border: 1px solid var(--accent); border-radius: 6px; }
.pub-links a:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.tag { color: var(--accent-2); font-size: .82rem; font-weight: 600; margin-bottom: .4em; }
.project p:not(.tag) { color: var(--muted); font-size: .95rem; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: .78rem; background: var(--bg-alt); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }

/* ---------- Education / timeline ---------- */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; }
.timeline { list-style: none; padding: 0 0 0 20px; margin: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 24px 8px; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-alt); }
.timeline .when { font-size: .85rem; color: var(--accent-2); font-weight: 600; }
.timeline h3 { margin: 2px 0; }
.timeline p { color: var(--muted); margin: 0; font-size: .95rem; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 10px 0; border-bottom: 1px dashed var(--border); }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact address { font-style: normal; color: var(--muted); margin-top: 20px; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .88rem; text-align: center; }
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 10px 12px; }
  .theme-btn { margin: 8px 0 0 12px; }
  .hero { padding: 40px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .portrait img { width: 160px; height: 160px; margin: 0 auto; }
  .lead { margin-left: auto; margin-right: auto; }
  .links { justify-content: center; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .section { padding: 48px 0; }
  .wrap { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .theme-btn, .links, .skip { display: none; }
  .alt { background: none; }
}
