/* David Acuna — homepage styles. Plain CSS, no build step.
   Colours and sizes are set once in :root below. */

/* ---------- Font (IBM Plex Sans, self-hosted; SIL Open Font License) ---------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Optional font (Inter, self-hosted; SIL Open Font License) ----------
   Not used by default: the files are only downloaded if "Inter" is added to --font below. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: #16181c;          /* main text */
  --muted: #5a616c;       /* secondary text: authors, dates, captions */
  --rule: #e6e7ea;        /* hairlines and borders */
  --surface: #f6f6f4;     /* pills, filter background */
  --link: #1b57b3;
  --link-hover: #0e3a80;
  --mark: #a3271e;        /* Oral / Spotlight badges */
  --mark-bg: #fbefed;
  --nav-bg: rgba(255, 255, 255, 0.88);

  /* IBM Plex Sans is bundled in fonts/, so the page looks the same on every device.
     Alternatives: replace "IBM Plex Sans" with "Inter" (also bundled), or delete it to use each
     visitor's system font (San Francisco on Apple devices, Segoe UI on Windows). */
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --width: 900px;
  --date-col: 104px;      /* width of the date column in News, Talks, etc. */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --fg: #e7e8ea;
    --muted: #a1a7b1;
    --rule: #272a2f;
    --surface: #1a1d20;
    --link: #8fb9ff;
    --link-hover: #bcd5ff;
    --mark: #ff9d8f;
    --mark-bg: #3a1d19;
    --nav-bg: rgba(17, 19, 21, 0.88);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;   /* keeps headings clear of the sticky bar */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

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

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

p { margin: 0 0 14px; }
b, strong { font-weight: 600; }
.small { font-size: 14px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.topics { margin: -10px 0 18px; color: var(--muted); font-size: 14px; }

/* ---------- Top bar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 52px;
}
.nav-name {
  color: var(--fg);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-name:hover { color: var(--fg); text-decoration: none; }
.nav-links {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  font-size: 14.5px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--fg); text-decoration: none; }

/* ---------- About ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 52px;
  align-items: start;
  padding: 60px 0 8px;
}
.hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.role {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 17px;
}
.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 6px;
}
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}
.pill {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.pill:hover {
  color: var(--fg);
  border-color: var(--muted);
  text-decoration: none;
}

/* ---------- Sections ---------- */
section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
h2 {
  margin: 0 0 18px;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
}
h3.sub {
  margin: 30px 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
h2 + h3.sub { margin-top: 4px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.section-head h2 { margin: 0; }

/* ---------- Research ---------- */
.lead { font-size: 17px; }

.threads { margin-top: 22px; }
.thread {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 36px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.thread h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.thread-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.thread > p {
  margin: 0;
  font-size: 15.5px;
}
/* Picture under each row's heading. The drawings are transparent SVGs that follow light/dark mode. */
.thread-head img {
  display: block;
  width: 156px;            /* size of the Research pictures */
  max-width: 100%;
  height: auto;
  margin-top: 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.thread-head img.figure {       /* a figure with its own white background */
  background: #ffffff;
  padding: 6px;
}
.thread-head a { display: block; cursor: zoom-in; }

/* ---------- Dated rows: News, Talks, Awards, Teaching, Patents ---------- */
.rows { margin: 0; }
.row {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  gap: 20px;
  padding: 7px 0;
  font-size: 15.5px;
}
.row time {
  color: var(--muted);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.row p { margin: 0; }

details.more { margin-top: 6px; }
details.more summary {
  display: inline-block;
  cursor: pointer;
  color: var(--link);
  font-size: 14.5px;
  padding: 4px 0;
  list-style: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " +"; }
details.more[open] summary::after { content: " \2212"; }

/* ---------- Publications ---------- */
.filter {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
}
.filter[hidden] { display: none; }
.filter button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  padding: 3px 13px;
  border-radius: 999px;
  cursor: pointer;
}
.filter button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--rule);
}

.pubs { margin-top: 12px; }
.pubs[data-show="selected"] .pub:not([data-selected]) { display: none; }

.pub {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.pub img {
  width: 176px;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px;
}
.pub h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.pub h3 a { color: var(--fg); }
.pub h3 a:hover { color: var(--link); text-decoration: none; }
.pub p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
}
.pub .authors { color: var(--muted); }
.pub .authors b { color: var(--fg); white-space: nowrap; }
.pub .venue { margin-top: 4px; }
.pub .links { margin-top: 2px; }
.pub .links a + a::before {
  content: "\00b7";
  display: inline-block;
  margin: 0 7px 0 4px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--mark-bg);
  color: var(--mark);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: 1px;
}

/* ---------- Lists ---------- */
ul.plain, ul.people {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15.5px;
}
ul.plain li { padding: 5px 0; }
ul.people { margin-top: 14px; }
ul.people li {
  padding: 6px 0;
  border-top: 1px solid var(--rule);
}
ul.people li:last-child { border-bottom: 1px solid var(--rule); }
ul.people span { color: var(--muted); margin: 0 6px 0 4px; }
ul.people a { font-size: 14.5px; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 72px;
  padding-bottom: 44px;
  color: var(--muted);
  font-size: 13.5px;
}
.footer p {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 32px;
  }
  .portrait {
    order: -1;
    width: 132px;
    border-radius: 12px;
    margin-top: 0;
  }
  .hero h1 { font-size: 33px; }
  .nav-name { display: none; }
  .nav-links { gap: 20px; }

  section { margin-top: 44px; padding-top: 32px; }

  .thread {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .thread-head img { width: 176px; margin-top: 10px; }
  .pub {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
  }
  .pub img { width: 96px; padding: 4px; border-radius: 6px; }
  .pub h3 { font-size: 15.5px; }

  :root { --date-col: 84px; }
  .row { gap: 12px; }
}

@media print {
  .nav, .filter { display: none; }
  .pubs[data-show="selected"] .pub:not([data-selected]) { display: grid; }
  details.more > .rows { display: block; }
}
