/* Ryan Phillip Quandt — academic site
   Plain static CSS. No build step, no dependencies. */

:root {
  --bg: #ffffff;
  --surface: #f7f8f9;
  --text: #1c1f23;
  --muted: #5f6a75;
  --rule: #e2e6ea;
  --accent: #1f4e79;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --wrap: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --text: #e6e9ec;
    --muted: #a2acb6;
    --rule: #2c3238;
    --accent: #8ab4dd;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: currentColor;
}

/* ---------- header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  padding-bottom: 18px;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  color: var(--text);
  border-bottom: none;
}

.site-title:hover { border-bottom: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--muted);
  padding-bottom: 2px;
}

.site-nav a:hover { color: var(--accent); }

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

/* ---------- page structure ---------- */

main { padding: 44px 24px 72px; }

h1 {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 6px;
}

h2 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 48px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 28px 0 6px;
}

p { margin: 0 0 16px; }

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* ---------- home ---------- */

/* Portrait comes first in the HTML so it stacks on top on narrow screens;
   `order` swaps it to the right of the text once there's room for two columns. */
.intro {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  align-items: flex-start;
}

.intro-text { flex: 1 1 380px; order: 1; }

.portrait {
  flex: 0 0 200px;
  width: 200px;
  order: 2;
}

.portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}

.portrait-fallback {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 2rem;
  letter-spacing: 0.05em;
}

.contact {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.contact dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 16px;
  margin: 0;
}

.contact dt { color: var(--muted); }
.contact dd { margin: 0; }

.linklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

/* ---------- publications ---------- */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pubs > li {
  margin: 0 0 26px;
}

.pub-title {
  font-weight: 600;
}

/* Linked titles read as titles, not as blue links; they take the accent on hover. */
.pub-title a {
  color: inherit;
}

.pub-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pub-meta {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 2px;
}

.pub-links {
  font-size: 0.88rem;
  margin-top: 4px;
}

.pub-links a { margin-right: 14px; }

.note {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- research: sub-nav + area cards ---------- */

h1 + .sub-nav { margin-top: 22px; }

.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 0.92rem;
  margin: 0 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.sub-nav a {
  color: var(--muted);
  padding-bottom: 2px;
}

.sub-nav a:hover { color: var(--accent); }

.sub-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

/* The lede sits above the sub-nav on research pages; tighten its bottom margin there. */
.sub-nav + section h2,
.sub-nav + h2 { margin-top: 36px; }

#summary { margin: 28px 0 40px; }
#summary p { max-width: 68ch; }

.areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.area {
  display: block;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--text);
}

.area:hover {
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}

.area h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--accent);
}

.area p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.area .more {
  display: block;
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--accent);
}

/* ---------- CV ---------- */

.cv-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 20px;
  margin-bottom: 20px;
}

.cv-when {
  color: var(--muted);
  font-size: 0.93rem;
  padding-top: 2px;
}

.cv-what strong { font-weight: 600; }

.cv-where {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- buttons ---------- */

.button {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-size: 0.93rem;
  color: var(--accent);
}

.button:hover {
  background: var(--accent);
  color: var(--bg);
  border-bottom-color: var(--accent);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 22px 24px 40px;
  color: var(--muted);
  font-size: 0.87rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.site-footer a { color: var(--muted); }

/* ---------- small screens ---------- */

@media (max-width: 620px) {
  body { font-size: 16px; }
  h1 { font-size: 1.75rem; }
  main { padding-top: 32px; }
  .header-inner { padding-bottom: 14px; }
  .site-nav { gap: 16px; font-size: 0.9rem; }
  .portrait { order: 0; flex-basis: 160px; width: 160px; margin: 0 auto; }
  .intro { gap: 24px; }
  .cv-entry { grid-template-columns: 1fr; gap: 2px; }
  .contact dl { grid-template-columns: 1fr; gap: 2px; }
  .contact dt { margin-top: 10px; }
}
