:root {
  --bg:      #f5f2eb;
  --surface: #fffdf8;
  --text:    #232020;
  --muted:   #5d5751;
  --accent:  #b8442a;
  --rule:    #cfc7ba;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #16140f;
    --surface: #1e1b16;
    --text:    #ece6dc;
    --muted:   #a79f93;
    --accent:  #e2704f;
    --rule:    #3b352c;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  margin: 0;
  padding: clamp(1rem, 5vw, 2.5rem) clamp(0.6rem, 4vw, 1.25rem) 3rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 46rem;
  min-width: 0;
  padding: clamp(1.5rem, 5vw, 2.75rem) clamp(1rem, 5vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

/* --- masthead --- */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.masthead h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}


.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: clamp(0.8rem, 3.1vw, 0.92rem);
}

.contact li { white-space: nowrap; }

.contact li:not(:last-child)::after {
  content: "|";
  margin: 0 0.5rem;
  color: var(--rule);
}

/* --- sections --- */

section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

h2 {
  margin: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

h3 {
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 400;
}

h3 .divider { color: var(--muted); }

p { margin: 0; }

/* --- entries --- */

.entry {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.entry + .entry {
  padding-top: 1.35rem;
  border-top: 1px dotted var(--rule);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1.5rem;
}

.dates {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.entry ul {
  margin: 0;
  padding-left: 1.15rem;
}

.entry li { margin-bottom: 0.2rem; }

/* education rows */
ul.rows {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1.5rem;
  margin: 0;
}

ul.rows li > span:first-child { min-width: 0; }

/* --- publications --- */

.citation {
  line-height: 1.6;
  overflow-wrap: anywhere;    /* doi breaks sometimes */
}

/* --- skills --- */

/* don't let them overlap lines */
.skills {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.skill {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
}

.skill dt {
  flex: 0 0 10.5rem;
  font-weight: 700;
}


.skill dd {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
}

@media (max-width: 34rem) {
  .skills { gap: 0.7rem; }
  .skill dt,
  .skill dd { flex-basis: 100%; }
}

/* --- links --- */

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 2px;
}

a:hover { text-decoration-color: currentColor; }

/* --- footer --- */

footer {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.download {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-size: 0.95rem;
  text-decoration: none;
}

.download:hover {
  background: var(--accent);
  color: var(--surface);
}

/* --- print --- */

@media print {
  body { display: block; padding: 0; background: #fff; color: #000; font-size: 11pt; }
  .page { max-width: none; padding: 0; border: 0; background: #fff; }
  footer { display: none; }
  a { color: #000; }
}
