:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-alt: #f3f1ec;
  --text: #1c1b1a;
  --muted: #6b6862;
  --accent: #bf5700;   /* UT Austin burnt orange */
  --accent-2: #333f48; /* UT charcoal */
  --border: #e7e3db;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 16px;
  --maxw: 1080px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-alt: #12141a;
  --text: #eceae6;
  --muted: #9a968e;
  --accent: #ff9a52;
  --accent-2: #333f48;
  --border: #262a33;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); }

@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px;
  padding: 72px 24px 56px; align-items: center;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
  font-weight: 600; color: var(--accent); margin: 0 0 12px;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin: 0 0 18px; }
.lede { font-size: 1.2rem; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 26px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-theme="dark"] .btn.primary { color: #0f1115; }
.btn.ghost { background: transparent; }

.social { color: var(--muted); font-size: .95rem; }
.social a { color: var(--muted); font-weight: 500; }
.social a:hover { color: var(--accent); }
.social span { margin: 0 8px; opacity: .5; }

.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.avatar {
  width: 96px; height: 96px; border-radius: 24px; margin-bottom: 18px;
  overflow: hidden; border: 3px solid var(--accent-2); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--accent), #8f3f00);
}
.avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 21px; /* inherit minus border so WebKit clips corners */
}
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 12px; align-items: center; padding: 7px 0; color: var(--muted); font-size: .98rem; }
.facts li span { width: 22px; text-align: center; }

@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2, .wrap.section h2 { font-size: 1.9rem; margin: 0 0 20px; }
.section-lede { color: var(--muted); max-width: 60ch; margin: 0 0 32px; font-size: 1.05rem; }
.prose p { max-width: 68ch; margin: 0 0 18px; }
.prose strong { color: var(--text); }
.note { color: var(--muted); font-size: .9rem; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card-icon { font-size: 1.8rem; margin-bottom: 10px; }
.card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }
.card.project h3 { font-family: "Newsreader", Georgia, serif; font-style: italic; }
.card .links { margin-top: 14px; }
.card .links a { font-weight: 600; }

@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Publications ---------- */
.pubs { list-style: none; counter-reset: pub; margin: 0; padding: 0; }
.pubs li {
  position: relative; padding: 20px 0 20px 44px; border-bottom: 1px solid var(--border);
}
.pubs li::before {
  counter-increment: pub; content: counter(pub);
  position: absolute; left: 0; top: 22px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: .82rem; font-weight: 700; color: var(--muted);
}
.pubs h3 { font-size: 1.12rem; margin: 0 0 6px; }
.authors { margin: 0 0 4px; font-size: .96rem; }
.venue { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
.links { margin: 0; font-size: .9rem; }
.tag {
  display: inline-block; background: var(--accent-2); color: #1c1b1a;
  padding: 1px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 28px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.timeline .when { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Contact / Footer ---------- */
.contact { text-align: center; }
.contact p { max-width: 52ch; margin: 0 auto 22px; color: var(--muted); }
.contact-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.footer { text-align: center; padding: 40px 24px 56px; color: var(--muted); font-size: .9rem; }
.footer .tiny { font-size: .82rem; opacity: .7; margin-top: 4px; }
