:root {
  --bg: #faf8fc;
  --surface: #ffffff;
  --text: #211a2c;
  --muted: #5f5870;
  --rule: #e6dff0;
  --accent: #6a3d9a;        /* primary purple */
  --accent-2: #a03a78;      /* plum, used sparingly in gradients */
  --tint: #f1eafa;          /* soft lavender for chips and pills */
  --tint-text: #4f2a7e;
  --header-from: #3a1d63;
  --header-to: #6a3d9a;
  --max: 46rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15121b;
    --surface: #1e1a27;
    --text: #ece8f3;
    --muted: #a8a0b6;
    --rule: #2f293b;
    --accent: #c3a2f0;
    --accent-2: #e58cc1;
    --tint: #2a2139;
    --tint-text: #dccaf7;
    --header-from: #241238;
    --header-to: #3f2266;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* Header / nav: deep purple band */
.site-header {
  background: linear-gradient(120deg, var(--header-from), var(--header-to));
  color: #fff;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1.25rem;
}
.site-name {
  font: 600 1.15rem/1.2 var(--serif);
  color: #fff;
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 0.15rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: #fff; }
.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 #d9c2ff;
}

main { padding-block: 3rem 4rem; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin: 0 0 0.5rem; font-weight: 600; }
h2 {
  position: relative;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
h3 { font-size: 1.1rem; margin: 0; font-weight: 600; }

.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 2rem; }

/* About */
.intro {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 2rem;
  align-items: center;
}
.portrait {
  width: 9rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--header-to), var(--accent-2));
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--tint);
  display: grid;
  place-items: center;
  color: #fff;
  font: 600 2.25rem var(--serif);
}
@media (max-width: 34rem) {
  .intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .portrait { width: 7rem; }
}

.focus { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.focus li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}
.focus strong { color: var(--tint-text); }

.connections {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}
.connection {
  display: grid;
  gap: 0.15rem;
  height: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--accent);
  border-radius: 0.5rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.connection:hover { border-color: var(--accent); transform: translateY(-2px); }
.connection-name { font: 600 1.05rem var(--serif); color: var(--tint-text); }
.connection-role { font-size: 0.9rem; color: var(--muted); }
.connection-site { font-size: 0.85rem; color: var(--accent); margin-top: 0.35rem; }
a[target="_blank"] .connection-site::after { content: " ↗"; }
@media (prefers-reduced-motion: reduce) {
  .connection { transition: none; }
  .connection:hover { transform: none; }
}

/* Resume */
.resume-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
}
.contact { color: var(--muted); margin: 0; font-size: 0.95rem; }
.contact span + span::before { content: "·"; margin: 0 0.5rem; }

.tagline {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font: 600 0.9rem var(--sans);
  cursor: pointer;
}
.button:hover { background: var(--tint-text); border-color: var(--tint-text); }

.entry {
  margin-bottom: 1.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--tint);
}
.entry:hover { border-left-color: var(--accent); }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  align-items: baseline;
}
.entry-meta {
  background: var(--tint);
  color: var(--tint-text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.entry-sub { color: var(--muted); margin: 0.1rem 0 0.5rem; }
.entry ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.entry li + li { margin-top: 0.25rem; }
.entry li::marker, .projects li::marker, .plain li::marker { color: var(--accent); }

.projects, .plain { padding-left: 1.2rem; margin: 0; }
.projects li + li { margin-top: 0.6rem; }
.projects strong { color: var(--tint-text); }
.plain li + li { margin-top: 0.2rem; }
.subhead { margin: 1.5rem 0 0.5rem; }
.publication { margin: 0; }

.skills { display: grid; gap: 1.25rem; margin: 0; }
.skills dt { font-weight: 600; margin-bottom: 0.5rem; }
.skills dd { margin: 0; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li {
  background: var(--tint);
  color: var(--tint-text);
  font-size: 0.85rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.site-footer {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--accent-2)) 1;
  color: var(--muted);
  font-size: 0.85rem;
  padding-block: 1.5rem;
}

/* Print: clean black-and-white resume */
@media print {
  :root {
    --bg: #fff; --text: #000; --muted: #444; --rule: #ccc;
    --accent: #000; --accent-2: #000; --tint: #fff; --tint-text: #000;
  }
  body { font-size: 10.5pt; }
  .site-header, .site-footer, .no-print { display: none !important; }
  main { padding: 0; }
  h2 { margin-top: 1.25rem; }
  h2::after { display: none; }
  a { color: inherit; text-decoration: none; }
  .entry { break-inside: avoid; margin-bottom: 1rem; border-left: 0; padding-left: 0; }
  .entry-meta { padding: 0; font-weight: 400; }
  .chips { gap: 0 0.25rem; }
  .chips li { padding: 0; font-size: inherit; }
  .chips li:not(:last-child)::after { content: " ·"; }
}

/* External links inside text */
a.ext::after { content: " ↗"; font-weight: 400; font-size: 0.85em; }
@media print { a.ext::after { content: none; } }
