/* ==========================================================================
   juliabaarck.github.io -- the site's only stylesheet.

   Deliberately dependency-free: no framework, no external fonts, no JS.
   Sections below, in order:
     1. Tokens          5. Home page
     2. Base            6. Research page
     3. Layout          7. CV page
     4. Header / nav    8. Footer
     9. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  /* Navy is lifted from Julia's own Stata figures so the charts sit naturally
     inside the page rather than fighting it. Crimson matches their zero-lines
     and is used only for the job-market flag. */
  --navy: #1f3b63;
  --navy-dark: #16294a;
  --crimson: #a4243b;

  --ink: #1c1f23;
  --ink-soft: #4a5260;
  --ink-faint: #6b7a90;

  --page: #ffffff;
  --tint: #f5f7fa;
  --rule: #dde3ec;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --measure: 1080px;   /* main content column */
  --gutter: 24px;
}

/* 2. Base ------------------------------------------------------------------ */

*,
*::before,
*::after { box-sizing: border-box; }

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

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy-dark);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--navy);
  text-decoration-color: rgba(31, 59, 99, 0.35);
  text-underline-offset: 2px;
}
a:hover { color: var(--crimson); text-decoration-color: currentColor; }

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

/* Screen-reader-only text (skip link, icon labels). */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* 3. Layout ---------------------------------------------------------------- */

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

main { padding: 40px 0 8px; }

.section { margin: 0 0 52px; }
.section:last-of-type { margin-bottom: 24px; }

/* Section headings sit on a hairline rule -- the standard academic-page look,
   done with a border rather than a decorative element. */
.section > h2 {
  font-size: 1.45rem;
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--rule);
}

/* 4. Header / nav ---------------------------------------------------------- */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 28px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy-dark);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.site-title:hover { color: var(--crimson); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
}

.site-nav a {
  font-size: 0.97rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--navy); }

.site-nav a[aria-current="page"] {
  color: var(--navy-dark);
  font-weight: 600;
  border-bottom-color: var(--navy);
}

/* 5. Home page ------------------------------------------------------------- */

.masthead {
  text-align: center;
  padding: 46px 0 30px;
}

.masthead h1 {
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  letter-spacing: 0.035em;
  margin-bottom: 10px;
}

.masthead .role {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0;
}

/* Photo left, text right -- collapses to a single column on narrow screens. */
.intro {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 44px;
  align-items: start;
  padding-bottom: 8px;
}

.intro-aside { position: sticky; top: 24px; }

.portrait {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

.contact {
  margin-top: 20px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.contact p { margin-bottom: 0.7em; }
.contact .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
  margin-bottom: 1px;
}

/* Plain profile links under the address -- deliberately not buttons, so they
   don't compete with the navigation at the top of the page. */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.button {
  display: inline-block;
  text-align: center;
  padding: 11px 18px;
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--navy);
  color: var(--navy);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover { background: var(--navy); color: #fff; }

.button--solid { background: var(--navy); color: #fff; }
.button--solid:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }

.intro-body > h2 {
  font-size: 1.3rem;
  margin-top: 34px;
}
.intro-body > h2:first-child { margin-top: 0; }

/* Research-interest chips. */
.interests {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
  padding: 0;
}
.interests li {
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* The job-market paper callout on the home page. */
.jmp-card {
  border-left: 3px solid var(--navy);
  background: var(--tint);
  padding: 18px 22px;
  border-radius: 0 3px 3px 0;
}
.jmp-card .title {
  font-family: var(--serif);
  font-size: 1.13rem;
  font-weight: 600;
  color: var(--navy-dark);
  display: block;
  line-height: 1.35;
  margin-bottom: 10px;
  text-decoration: none;
}
.jmp-card .title:hover { color: var(--crimson); text-decoration: underline; }
.jmp-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fact-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.fact-list li:last-child { border-bottom: 0; }
.fact-list .when {
  /* Wide enough for the longest entry ("2016, 2019, 2020") to stay on one line. */
  flex: 0 0 136px;
  color: var(--ink-faint);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.fact-list .what { flex: 1 1 260px; }

/* 6. Research page --------------------------------------------------------- */

.paper {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 38px;
  align-items: start;
  padding-bottom: 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}

/* Entries with no figure simply span the full width -- no empty column. */
.paper--nofigure { grid-template-columns: 1fr; }

.section .paper:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 6px; }

.paper h3 {
  font-size: 1.22rem;
  margin-bottom: 6px;
}
.paper h3 a { text-decoration: none; }

.paper .authors {
  color: var(--ink-soft);
  font-size: 0.97rem;
  margin-bottom: 8px;
}

.paper .status {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

/* Accepted / R&R badges read at a glance in a long list. */
.badge {
  display: inline-block;
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(31, 59, 99, 0.08);
  color: var(--navy);
  margin-right: 8px;
  vertical-align: 1px;
}
.abstract {
  font-size: 0.97rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.paper-links a {
  display: inline-block;
  font-size: 0.87rem;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 13px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--navy);
  background: var(--page);
}
.paper-links a:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Press pickup, listed under a paper's own links. Deliberately lighter than
   .paper-links so the paper itself stays the primary call to action. */
.media {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 12px 0 0;
  font-size: 0.89rem;
}
.media-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.media a { color: var(--ink-soft); }
.media a:hover { color: var(--crimson); }

.compact-list .media { margin-top: 8px; }

.paper-figure { margin: 0; }
.paper-figure img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
}
.paper-figure figcaption {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 8px;
  line-height: 1.45;
}

/* Policy work and other compact lists. */
.compact-list { list-style: none; margin: 0; padding: 0; }
.compact-list > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.compact-list > li:last-child { border-bottom: 0; }
.compact-list .title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-dark);
  display: block;
  margin-bottom: 3px;
  line-height: 1.35;
}
.compact-list .meta {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.lede {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 68ch;
  margin-bottom: 34px;
}

.page-title {
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  margin: 30px 0 10px;
}

/* 7. CV page --------------------------------------------------------------- */

.cv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-bottom: 34px;
}
.cv-actions .button { padding: 12px 24px; }
.cv-actions .updated {
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* Page images rather than an embedded PDF viewer: they paint immediately and
   behave the same in every browser. */
.cv-pages {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 0 8px;
  max-width: 860px;
}
.cv-pages a { display: block; }
.cv-pages img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(28, 31, 35, 0.07);
}
.cv-pages a:hover img { border-color: var(--navy); }

.cv-hint {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

/* 8. Footer ---------------------------------------------------------------- */

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--rule);
  background: var(--tint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-soft); }

/* 9. Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
  .paper { grid-template-columns: 1fr 300px; gap: 30px; }
  .intro { grid-template-columns: 240px 1fr; gap: 34px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  main { padding-top: 26px; }
  .masthead { padding: 32px 0 24px; }

  .intro { grid-template-columns: 1fr; gap: 28px; }
  .intro-aside {
    position: static;
    max-width: 260px;
    margin: 0 auto;
    text-align: center;
  }
  .contact .label { justify-content: center; }

  /* Figure moves below the text on narrow screens, matching reading order. */
  .paper { grid-template-columns: 1fr; gap: 22px; }
  .paper-figure { max-width: 460px; }

  .section { margin-bottom: 40px; }
  .fact-list .when { flex-basis: 100%; }
}

@media (max-width: 420px) {
  :root { --gutter: 18px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 4px 18px; }
}

/* Printing the CV page or research list should not waste ink on chrome. */
@media print {
  .site-header, .site-footer, .cv-actions, .skip-link { display: none; }
  body { font-size: 11pt; }
  .paper { break-inside: avoid; border-bottom: 0; }
  a { text-decoration: none; color: var(--ink); }
}
