:root {
  --text: #1c2733;
  --muted: #5b6875;
  --bg: #f8fafd;
  --band: #f4f6f8;
  --accent: #1d4ed8;
  --navy: #14305c;
  --blue-soft: #c7d9f7;
  --pop: #ea580c;
  --border: #dde3e9;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Abstract background: soft pastel shapes, fixed behind the page */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(38rem 30rem at 8% 6%,  rgba(147, 197, 253, 0.35), transparent 70%),
    radial-gradient(34rem 28rem at 95% 14%, rgba(196, 181, 253, 0.30), transparent 70%),
    radial-gradient(40rem 32rem at 80% 88%, rgba(153, 246, 224, 0.28), transparent 70%),
    radial-gradient(30rem 26rem at 5% 80%,  rgba(253, 220, 190, 0.30), transparent 70%),
    var(--bg);
}

/* Icons: outline style in a contrasting orange */
.icon {
  width: 1.15em; height: 1.15em; flex-shrink: 0;
  margin-right: 0.5rem; vertical-align: -0.2em;
  fill: none; stroke: var(--pop); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Brand logos keep their own colors */
.logo { width: 1.3em; height: 1.3em; flex-shrink: 0; margin-right: 0.5rem; object-fit: contain; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 3.5rem; flex-wrap: wrap; gap: 0.25rem 1rem; }
.brand { font-weight: 650; color: var(--navy); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
nav a { margin-left: 1.25rem; color: var(--muted); font-size: 0.95rem; }
nav a:hover { color: var(--accent); text-decoration: none; }

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 10px;
  background: none; border: 0; cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; }
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Headings */
h1, h2, h3 { line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2.4rem; margin: 0 0 0.25rem; color: var(--navy); }
h2 { font-size: 1.6rem; margin: 0 0 1.25rem; padding-bottom: 0.5rem; color: var(--accent); border-bottom: 2px solid var(--blue-soft); }
h3 { font-size: 1.15rem; margin: 2rem 0 0.75rem; color: var(--navy); }

section { padding: 3rem 0 1rem; }

/* Hero */
.hero { display: flex; gap: 2rem; align-items: center; padding-top: 3.5rem; }
.portrait { width: 220px; height: 220px; object-fit: cover; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border); background: var(--band); }
.role { margin: 0 0 0.35rem; color: var(--muted); font-size: 1.1rem; }
.org-logo { height: 1.7em; width: auto; vertical-align: middle; margin-right: 0.6rem; }
.affil { margin: 0 0 1rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.links a { display: inline-flex; align-items: center; font-weight: 500; }

/* Project and tool lists */
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; gap: 1rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.items li:last-child { border-bottom: 0; }
.items img { width: 64px; height: 48px; object-fit: contain; flex-shrink: 0; background: var(--band); border-radius: 4px; }
.items a { font-weight: 550; }
.meta { display: block; color: var(--muted); font-size: 0.92rem; }

.years { width: 6.5rem; flex-shrink: 0; color: var(--muted); font-size: 0.92rem; white-space: nowrap; }

/* Cards for tools and corpora */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem; color: var(--text);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border); border-radius: 8px;
}
.card:hover { text-decoration: none; border-color: var(--accent); }
.card img { height: 48px; width: auto; max-width: 100%; align-self: flex-start; object-fit: contain; margin-bottom: 0.5rem; min-width: 64px; background: var(--band); border-radius: 4px; }
.card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 48px; margin-bottom: 0.5rem;
  background: var(--band); border-radius: 4px;
}
.card-icon .icon { width: 1.8rem; height: 1.8rem; margin: 0; }
.card strong { color: var(--accent); font-weight: 600; line-height: 1.35; }
.card span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.placeholder { color: var(--muted); font-style: italic; }

/* Publications (bibtexbrowser output) */
#pubs table { width: 100%; border-collapse: collapse; }
#pubs td { vertical-align: top; padding: 0; }

/* Year headings: the full-width row bibtexbrowser adds above each group */
#pubs td[colspan], #pubs th {
  padding: 2rem 0 0.4rem;
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25;
  color: #ea580c /*var(--accent)*/;
  border-bottom: 2px solid var(--blue-soft);
}

/* Text style for the year label itself (class name used by bibtexbrowser) */
#pubs .sheader, #pubs .rheader {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--accent);
}

/* Hide the [59]-style numbering */
#pubs .bibanchor { display: none; }
#pubs td:first-child:not([colspan]) { display: none; }

/* Entries: orange document icon in front of each one */
#pubs td:not([colspan]) { padding: 0.75rem 0; font-size: 0.97rem; }
#pubs td:not([colspan])::before {
  content: ""; display: inline-block;
  width: 1.15em; height: 1.15em; margin-right: 0.6rem; vertical-align: -0.2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ea580c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8zM14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E") no-repeat center / contain;
}
#pubs tr + tr td:not([colspan]) { border-bottom: 1px solid var(--border); }
#pubs .bibtitle, #pubs b { font-weight: 600; }

address { font-style: normal; }
address p { display: flex; align-items: flex-start; margin: 0 0 0.6rem; }
address .icon { margin-top: 0.25rem; }

/* Footer */
.site-footer { margin-top: 4rem; padding: 1.5rem 0; background: rgba(255, 255, 255, 0.6); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

/* Mobile */
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; }
  h1 { font-size: 1.85rem; }

  .projects li { flex-wrap: wrap; }
  .years { width: 100%; }

  .menu-toggle { display: flex; }
  nav { display: none; width: 100%; flex-direction: column; padding-bottom: 0.5rem; }
  nav.open { display: flex; }
  nav a { margin: 0; padding: 0.6rem 0; border-top: 1px solid var(--border); font-size: 1rem; }
  .bar { padding-top: 0.25rem; padding-bottom: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
