/* Font: IBM Plex Sans, served from this site (assets/fonts, SIL Open Font License)
   so visitors' browsers never contact Google */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-600.woff2') format('woff2');
}

/* Colors — change these to re-theme the whole site */
:root {
  --ink: #16161D;
  --muted: #5A5A66;
  --accent: #D3687F;       /* link underlines */
  --accent-text: #A3415A;  /* hover highlight (readable with white text) */
  --tint: #F8E1E6;         /* soft pink: text tiles in Selected work */
  --rule: #E6E6EA;         /* every divider line except the header */

  /* Type scale: four sizes, two weights (400 regular, 600 bold) */
  --fs-xl: 32px;   /* name */
  --fs-lg: 17px;   /* bio, section headings */
  --fs-md: 15px;   /* body text, lists, tabs */
  --fs-sm: 13px;   /* dates, citations, footer */

  /* Layout */
  --gutter: 32px;  /* space between every column */
  --date-col: 72px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.45;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
/* Highlight on hover: pink fill, white text */
a:hover { background: var(--accent-text); color: #fff; text-decoration-color: var(--accent-text); }
/* Keyboard users (Tab key) get the same pink highlight, plus an outline */
a:focus-visible {
  background: var(--accent-text);
  color: #fff;
  text-decoration-color: var(--accent-text);
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px var(--gutter) 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.brand { display: flex; flex-direction: column; gap: 2px; }
/* The name is the page's main heading; keep it looking exactly as before */
.brand h1 { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.1; }
.name {
  font-weight: 600;
  font-size: var(--fs-xl);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.name:hover, .name:focus-visible { background: none; color: var(--ink); }
.tagline { color: var(--muted); }

/* Tabs: text sits flush with the right edge */
nav { display: flex; flex-wrap: wrap; gap: 4px; margin-right: -10px; }
nav a { padding: 2px 10px; text-decoration: none; }
nav a:hover { background: var(--accent-text); color: #fff; }
nav a[aria-current="page"] { background: var(--accent-text); color: #fff; }

main { padding-top: 32px; flex: 1; }
main > section[hidden] { display: none; }

h2 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: var(--fs-lg);
  line-height: 1.3;
}
.mono-date { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); color: var(--muted); padding-top: 1px; }
.meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.note { margin: 0; }

/* Every list row (news, selected work, publications, policy & press) shares this look */
.news-item, .pubs > div, .row {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}

/* Home */
.home { display: flex; flex-direction: column; gap: 40px; }
.intro { display: flex; flex-wrap: wrap; gap: var(--gutter); align-items: flex-start; }
.intro img {
  display: block;
  flex: 0 0 200px;
  width: 200px;
  height: 200px;
  object-fit: cover;
}
.intro-text { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.intro-text p { margin: 0; font-size: var(--fs-lg); line-height: 1.6; }
.links { display: flex; flex-wrap: wrap; gap: 6px 24px; }

/* Two equal columns, used on Home, Research and Policy & Press */
.columns, .topics, .public {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 40px var(--gutter);
  align-items: start;
}

.news-item, .row {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  gap: 16px;
}

/* Selected work: 2 x 2 grid of cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.card-thumb {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
}
/* Text tile for items without their own image */
.card-thumb-text {
  display: flex;
  align-items: flex-end;
  padding: 8px;
  background: var(--tint);
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
}
.card-body { display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 600; line-height: 1.3; }
a.card:hover, a.card:focus-visible { background: none; color: var(--ink); }
/* Quieter hover for Selected work: pink underline on the title, slight fade on the image */
a.card:hover .card-title, a.card:focus-visible .card-title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a.card:hover .card-thumb, a.card:focus-visible .card-thumb { opacity: .85; }
.card-meta { font-size: var(--fs-sm); color: var(--muted); }

/* Research */
.research { display: flex; flex-direction: column; gap: 32px; }
.topic h2 { margin-bottom: 12px; }
/* Award note: small outlined ribbon icon before the text */
.award { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.award svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Policy & Press */
/* On wide screens: a 2 x 2 grid so Press mentions lines up with Talks & events.
   On narrow screens the lists stack in page order: Op-eds, Press, Policy, Talks. */
@media (min-width: 896px) {
  .public { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
  .public .op-eds { grid-column: 1; grid-row: 1; }
  .public .policy { grid-column: 2; grid-row: 1; }
  .public .press  { grid-column: 1; grid-row: 2; }
  .public .talks  { grid-column: 2; grid-row: 2; }
  .public > .note { grid-row: 3; }
}
.row .where { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
/* End-of-page notes ("Full list on Google Scholar", "More on CDT"): right-aligned under both columns */
.research > .note, .public > .note { grid-column: 1 / -1; text-align: right; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 40px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Phones */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .wrap { padding-top: 20px; }
  nav { margin: 0 -10px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .intro img { width: 140px; height: 140px; flex-basis: 140px; }
}
