/* drjasondavis.com: modern single-column layout. Inter for UI, Newsreader for long-form reading. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1b1b1a;
  --muted: #6b6a66;
  --faint: #9a9892;
  --rule: #e8e5df;
  --accent: #e0531f;          /* the 💥 */
  --accent-soft: #fdeee6;
  --pill-company: #e7f0ff; --pill-company-fg: #1f4fbf;
  --pill-press:   #eef6ea; --pill-press-fg:   #2f6b1f;
  --pill-talk:    #f5ecfb; --pill-talk-fg:    #6b2c94;
  --code-bg: #f3f1ec;
  --link-line: #cfcbc3;       /* subtle link underline */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1a1a19;
    --text: #ecebe7;
    --muted: #a3a19b;
    --faint: #75736e;
    --rule: #2a2927;
    --accent: #ff7a45;
    --accent-soft: #2c1b13;
    --pill-company: #18233a; --pill-company-fg: #8fb2ff;
    --pill-press:   #1a2817; --pill-press-fg:   #9bd18a;
    --pill-talk:    #261a30; --pill-talk-fg:    #d1a6f0;
    --code-bg: #1f1e1c;
    --link-line: #4a4844;
  }
  .prose img { background: #fff; border-radius: 4px; }  /* old charts were drawn on white */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--rule); }
.nav a[aria-current] { color: var(--text); background: var(--rule); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 168px 1fr; gap: 36px; align-items: start; padding: 72px 0 32px; }
.hero-photo { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--rule); }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.hero h1 { margin: 0 0 18px; font-size: clamp(36px, 6vw, 52px); line-height: 1.02; font-weight: 700; letter-spacing: -.035em; }
.bio p { margin: 0 0 14px; font-size: 17px; line-height: 1.65; }

.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 22px 0 0; font-size: 14px; }
.hero-links a { padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 500; }
.hero-links a:hover { border-color: var(--accent); }
.hero-links .email { padding: 6px 4px; color: var(--muted); }

/* ---------- sections ---------- */
.block { padding: 44px 0 8px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 8px; }
.block-head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.block-head a { font-size: 14px; color: var(--muted); text-decoration: none; }
.block-head a:hover { color: var(--accent); }
.block-intro { color: var(--muted); margin: 14px 0 4px; }

.page-head { padding: 64px 0 24px; }
.page-head h1 { margin: 0 0 10px; font-size: clamp(34px, 5vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; }
.year-group { display: grid; grid-template-columns: 72px 1fr; gap: 0 20px; padding: 18px 0; border-top: 1px solid var(--rule); }
.year { margin: 14px 0 0; font-size: 14px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- news ---------- */
.news-list, .pub-list, .post-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; padding: 14px 0; }
.news-item + .news-item { border-top: 1px dashed var(--rule); }
.news-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.news-title { font-weight: 600; text-decoration: none; }
a.news-title:hover { color: var(--accent); }
.news-source { display: block; font-size: 13px; color: var(--muted); }
.news-body p { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.year-group .news-item { grid-template-columns: 1fr; }
.year-group .news-meta { flex-direction: row; align-items: center; gap: 10px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.pill-company { background: var(--pill-company); color: var(--pill-company-fg); }
.pill-press { background: var(--pill-press); color: var(--pill-press-fg); }
.pill-talk { background: var(--pill-talk); color: var(--pill-talk-fg); }
.pill-note { background: var(--accent-soft); color: var(--accent); margin-left: 6px; font-style: normal; }

/* ---------- publications ---------- */
.pub { padding: 16px 0; }
.pub + .pub { border-top: 1px dashed var(--rule); }
.pub-title { font-weight: 600; font-size: 16.5px; text-decoration: none; line-height: 1.4; }
.pub-title:hover { color: var(--accent); }
.pub-authors { font-size: 14px; color: var(--muted); margin-top: 3px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-size: 14px; font-style: italic; color: var(--muted); }
.pub-links { display: flex; gap: 6px; margin-top: 8px; }
.pub-links a { font-size: 12px; font-weight: 600; padding: 2px 10px; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--muted); }
.pub-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- research overview ---------- */
.research .lede { font-family: var(--serif); font-size: 21px; line-height: 1.55; margin: 0 0 28px; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.theme { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 20px 22px; }
.theme h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.theme h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 9px; vertical-align: 2px; }
.theme p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.theme a { color: var(--text); }

/* ---------- writing archive ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips a { font-size: 13px; font-weight: 500; padding: 5px 13px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--surface); }
.chips a:hover { color: var(--text); }
.chips a[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text); }
.post-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; }
.post-row > a { font-weight: 500; text-decoration: none; }
.post-row > a:hover { color: var(--accent); }
.post-row-meta { display: flex; gap: 12px; white-space: nowrap; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.post-row-cat { color: var(--muted); }

/* ---------- article ---------- */
.article { max-width: 40rem; margin: 0 auto; }
.article-head { padding: 64px 0 28px; }
.article-head h1 { margin: 0 0 14px; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; }
.article-meta { margin: 0; font-size: 14px; color: var(--muted); }
.prose { font-family: var(--serif); font-size: 20px; line-height: 1.65; overflow-wrap: break-word; }
.prose p { margin: 0 0 1.1em; }

.prose h2, .prose h3, .prose h4 { font-family: var(--sans); letter-spacing: -.015em; line-height: 1.3; margin: 2em 0 .6em; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 19px; }
.prose h4 { font-size: 17px; }
.prose img, .prose iframe { max-width: 100%; height: auto; }
.prose img { display: block; margin: 1.6em auto; border-radius: 6px; }
.prose iframe { display: block; margin: 1.6em auto; border: 0; }
.prose figure { margin: 1.8em 0; }
.prose figure img { margin: 0 auto; }
.prose figcaption { font: 14px/1.4 var(--sans); color: var(--muted); text-align: center; margin-top: .6em; }
.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose pre, .prose code { font-family: var(--mono); font-size: 14px; background: var(--code-bg); border-radius: 6px; }
.prose code { padding: .12em .35em; }
.prose pre { padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.prose pre code { padding: 0; background: none; }
.prose table { border-collapse: collapse; margin: 1.6em 0; font: 14px/1.4 var(--sans); display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; vertical-align: top; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 0; font-size: 13px; }
.tags a { color: var(--muted); text-decoration: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 15px; font-weight: 500; line-height: 1.4; }
.pager a { text-decoration: none; }
.pager small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.pager .older { text-align: right; grid-column: 2; }

/* ---------- footer ---------- */
.footer { margin-top: 80px; border-top: 1px solid var(--rule); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 48px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { text-decoration: none; }

/* ---------- small screens ---------- */
@media (max-width: 680px) {
  .topbar-inner { height: 56px; }
  .brand { font-size: 12px; letter-spacing: .1em; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-top: 40px; }
  .hero-photo { width: 112px; height: 112px; }
  .news-item { grid-template-columns: 1fr; }
  .news-meta { flex-direction: row; align-items: center; gap: 10px; }
  .year-group { grid-template-columns: 1fr; }
  .year { margin-top: 4px; }
  .themes { grid-template-columns: 1fr; }
  .post-row { flex-direction: column; gap: 2px; }
  .post-row-meta { white-space: normal; }
  .prose { font-size: 18px; }
  .page-head, .article-head { padding-top: 40px; }
}
