/* --------------------------------------------------------------------------
 * Fabrizio Silvestri — homepage
 * "Glass-light" theme in Sapienza amaranto: warm pastel background,
 * frosted glass surfaces, soft shadows, amaranto accents with gold on
 * secondary chips.
 * -------------------------------------------------------------------------- */

:root {
  --bg-1: #f5e3e6;          /* soft amaranto tint */
  --bg-2: #faeee1;           /* warm cream */
  --bg-3: #f3e3d8;           /* sand */
  --bg-4: #fdfbf8;           /* near-white warm */
  --ink: #231419;
  --ink-soft: #4b383e;
  --ink-muted: #7d686d;
  --accent-1: #8e1f2d;      /* amaranto Sapienza — primary */
  --accent-2: #b24455;      /* lighter amaranto — gradient partner */
  --accent-3: #5f1622;      /* deep burgundy — hover / darker end */
  --accent-gold: #a88929;   /* warm gold — secondary (topic chips) */
  --accent-gold-deep: #7a6120;
  --card-bg: rgba(255, 253, 251, 0.62);
  --card-border: rgba(255, 255, 255, 0.7);
  --card-shadow: 0 10px 40px -12px rgba(90, 22, 34, 0.18);
  --card-shadow-hover: 0 16px 56px -16px rgba(90, 22, 34, 0.28);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-w: 1080px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-4);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent-3); text-decoration: none; }
a:hover { color: var(--accent-1); text-decoration: underline; }

/* ---- Background: soft pastel gradient + blurred orbs ---- */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 800px at 10% 0%, var(--bg-1) 0%, transparent 60%),
    radial-gradient(1000px 700px at 95% 10%, var(--bg-2) 0%, transparent 55%),
    radial-gradient(1100px 900px at 50% 110%, var(--bg-3) 0%, transparent 60%),
    var(--bg-4);
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}
.orb-1 { width: 420px; height: 420px; top: -80px; left: -120px; background: #e8c5cb; }
.orb-2 { width: 380px; height: 380px; top: 120px; right: -100px; background: #f0d9b8; }
.orb-3 { width: 520px; height: 520px; bottom: -180px; left: 30%; background: #ecd0d3; }

/* ---- Sticky nav ---- */
.site-header {
  position: sticky;
  top: 20px;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  margin-top: 20px;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 14px 10px 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow: 0 10px 30px -12px rgba(90, 22, 34, 0.18);
  max-width: 100%;
}

.nav-brand {
  font-weight: 800;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-brand:hover { text-decoration: none; opacity: 0.85; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover {
  background: rgba(142, 31, 45, 0.1);
  color: var(--accent-1);
  text-decoration: none;
}

.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 6px 18px -6px rgba(142, 31, 45, 0.5);
}
.nav-cta:hover { text-decoration: none; filter: brightness(1.08); }

/* ---- Main / sections ---- */
main { max-width: var(--max-w); margin: 0 auto; padding: 40px 24px 80px; }

.section-head {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 56px 0 20px;
  text-transform: none;
  letter-spacing: 0.01em;
}
.section-head .slash {
  color: var(--accent-1);
  margin-right: 8px;
}

.content { scroll-margin-top: 96px; }

/* ---- Hero ---- */
.hero {
  padding: 72px 0 32px;
  scroll-margin-top: 96px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
.hero-title {
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.hero-title .grad {
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 60%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 56ch;
}
.hero-lede strong { color: var(--ink); font-weight: 600; }

.hero-stats {
  display: flex;
  gap: 28px;
  padding: 18px 24px;
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  margin-bottom: 26px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.hero-stats > div { display: flex; flex-direction: column; }
.stat-num {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat-lbl {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff !important;
  box-shadow: 0 10px 24px -8px rgba(142, 31, 45, 0.45);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(142, 31, 45, 0.6); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink) !important;
  border: 1px solid rgba(142, 31, 45, 0.3);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.85); }

/* ---- Hero photo ---- */
.hero-photo { display: flex; justify-content: center; }
.photo-ring {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow: 0 20px 60px -20px rgba(142, 31, 45, 0.4);
}
.photo-ring::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 68, 85, 0.18) 0%, transparent 70%);
  z-index: -1;
}
.photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
}

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 28px 32px;
}

.prose p { margin: 0 0 14px; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---- Research grid ---- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.research-card { padding: 26px 26px; transition: transform 0.2s, box-shadow 0.2s; }
.research-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.research-card h3 {
  margin: 14px 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.research-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.research-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(142, 31, 45, 0.14), rgba(168, 137, 41, 0.14));
  color: var(--accent-1);
  font-size: 20px;
  font-weight: 700;
}

/* ---- Publications ---- */
.pub-meta {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.pub-download {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(142, 31, 45, 0.4);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-1);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}
.pub-download:hover {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(142, 31, 45, 0.5);
}
/* ---- Filter rows ---- */
.pub-filter-group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.pub-filter-group:last-child { margin-bottom: 22px; }
.pub-filter-label {
  flex-shrink: 0;
  width: 54px;
  padding-top: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: right;
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.pub-tab {
  font: inherit;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pub-tab-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}
.pub-tab.is-active .pub-tab-count {
  background: rgba(255, 255, 255, 0.25);
  opacity: 0.95;
}

/* TYPE row — primary filter: rounded pills, amaranto gradient on active. */
.pub-filters-type .pub-tab {
  padding: 9px 16px;
  border: 1px solid rgba(142, 31, 45, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.pub-filters-type .pub-tab:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border-color: rgba(142, 31, 45, 0.45);
}
.pub-filters-type .pub-tab.is-active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(142, 31, 45, 0.5);
}

/* TOPIC row — secondary filter: square chips with "#" prefix, gold active. */
.pub-filters-topic .pub-tab {
  padding: 5px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
}
.pub-filters-topic .pub-tab::before {
  content: "#";
  color: rgba(168, 137, 41, 0.7);
  font-weight: 700;
  margin-right: -2px;
}
.pub-filters-topic .pub-tab:hover {
  background: rgba(168, 137, 41, 0.08);
  border-color: rgba(168, 137, 41, 0.4);
  color: var(--accent-gold-deep);
}
.pub-filters-topic .pub-tab:hover::before { color: var(--accent-gold-deep); }
.pub-filters-topic .pub-tab.is-active {
  background: rgba(168, 137, 41, 0.18);
  border-color: rgba(168, 137, 41, 0.6);
  color: var(--accent-gold-deep);
  font-weight: 600;
}
.pub-filters-topic .pub-tab.is-active::before { color: var(--accent-gold-deep); }
.pub-filters-topic .pub-tab.is-active .pub-tab-count {
  background: rgba(168, 137, 41, 0.22);
  color: var(--accent-gold-deep);
}

.pub-year-block { margin-bottom: 10px; }
.pub-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-1);
  margin: 22px 0 10px;
  padding-left: 4px;
  letter-spacing: 0.04em;
}

.pub-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: background 0.15s, transform 0.15s;
}
.pub-item:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(2px);
}
.pub-badge {
  align-self: start;
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  min-width: 82px;
  text-align: center;
}
/* Conference = green (A* dark, other light); Journal = blue (Q1 dark, other light);
   Workshop = amber; Preprint = red. */
.pub-badge.type-a_star_conf    { background: rgba(5, 150, 105, 0.18);  color: #065f46; }   /* emerald-700 */
.pub-badge.type-other_conf     { background: rgba(34, 197, 94, 0.15);  color: #16a34a; }   /* green-600 */
.pub-badge.type-q1_journal     { background: rgba(29, 78, 216, 0.18);  color: #1e3a8a; }   /* blue-900 */
.pub-badge.type-other_journal  { background: rgba(59, 130, 246, 0.15); color: #2563eb; }   /* blue-600 */
.pub-badge.type-workshop       { background: rgba(245, 158, 11, 0.18); color: #b45309; }   /* amber-700 */
.pub-badge.type-preprint       { background: rgba(239, 68, 68, 0.15);  color: #b91c1c; }   /* red-700 */

.pub-body { min-width: 0; }
.pub-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--accent-1); }
.pub-authors {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.pub-authors .me { color: var(--accent-1); font-weight: 600; }
.pub-venue {
  margin: 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}
.pub-cites,
.pub-link {
  color: var(--accent-1);
  font-weight: 600;
  white-space: nowrap;
}
.pub-cites:hover,
.pub-link:hover { text-decoration: underline; }
.pub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pub-chip {
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(142, 31, 45, 0.2);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.pub-chip:hover {
  background: rgba(142, 31, 45, 0.1);
  color: var(--accent-1);
  border-color: rgba(142, 31, 45, 0.35);
}
.pub-empty {
  text-align: center;
  color: var(--ink-muted);
  padding: 30px;
  font-size: 14px;
}

.pub-older-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.pub-older-toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px dashed rgba(142, 31, 45, 0.5);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-1);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pub-older-toggle:hover {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(142, 31, 45, 0.5);
}
.pub-older-years {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  opacity: 0.7;
}

/* ---- Awards ---- */
.awards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.award-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 14px 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.15s;
}
.award-item:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(2px);
}
.award-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: 0.04em;
}
.award-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.award-title a { color: inherit; }
.award-title a:hover { color: var(--accent-1); }
.award-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- Talks ---- */
.talks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.talk-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 14px 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.15s;
}
.talk-item:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(2px);
}
.talk-year {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: 0.04em;
}
.talk-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: inline;
}
.talk-title a { color: inherit; }
.talk-title a:hover { color: var(--accent-1); }
.talk-role {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-gold-deep);
  background: rgba(168, 137, 41, 0.15);
  border-radius: 999px;
  vertical-align: 2px;
}
.talk-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- Teaching ---- */
.course-list {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.course-list > li {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.15s;
}
.course-list > li:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateX(2px);
}
.course-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.course-title a { color: var(--ink); }
.course-title a:hover { color: var(--accent-1); }
.course-lang {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(142, 31, 45, 0.16), rgba(168, 137, 41, 0.18));
  color: var(--accent-1);
  letter-spacing: 0.04em;
}
.course-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.contact-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-mono);
}
.contact-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social a {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(142, 31, 45, 0.25);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.15s;
}
.social a:hover {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  text-decoration: none;
  border-color: transparent;
}

/* ---- Cookie consent banner ---- */
#cookie-banner[hidden] { display: none; }
#cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 16px 22px;
  background: rgba(255, 253, 251, 0.82);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(142, 31, 45, 0.22);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px -20px rgba(90, 22, 34, 0.28);
  max-width: calc(var(--max-w) - 40px);
  margin: 0 auto;
}
.cookie-copy {
  margin: 0;
  flex: 1 1 260px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-actions .btn { padding: 9px 18px; font-size: 13px; }
@media (max-width: 640px) {
  #cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 14px 16px;
  }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; text-align: center; }
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 30px 20px 40px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .hero {
    padding: 32px 0 16px;
    scroll-margin-top: 80px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: left;
    justify-items: start;
  }
  .hero-photo { order: -1; justify-self: center; }
  .photo-ring { width: min(220px, 60vw); }
  .hero-title { font-size: clamp(40px, 11vw, 60px); }
  .hero-lede { font-size: 16px; }
  .nav-cta { display: none; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
}

@media (max-width: 640px) {
  main { padding: 24px 14px 60px; }
  html { scroll-padding-top: 84px; }

  .site-header { top: 12px; margin-top: 12px; padding: 0 12px; }
  .nav-pill {
    gap: 4px;
    padding: 6px 8px;
    max-width: calc(100vw - 24px);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-pill::-webkit-scrollbar { display: none; }
  .nav-brand { font-size: 15px; padding: 3px 8px; }
  .nav-links { flex-wrap: nowrap; gap: 0; }
  .nav-links a {
    padding: 5px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .card { padding: 22px 20px; border-radius: 20px; }

  .hero-stats { gap: 16px; padding: 14px 18px; width: 100%; }
  .stat-num { font-size: 20px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; text-align: center; }

  /* Filter groups: label stacks on top, tabs scroll horizontally. */
  .pub-filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 14px;
  }
  .pub-filter-label {
    width: auto;
    padding-top: 0;
    text-align: left;
  }
  .pub-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .pub-filters::-webkit-scrollbar { display: none; }
  .pub-tab { flex-shrink: 0; }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px;
  }
  .pub-title { font-size: 14px; }
  .pub-authors { font-size: 12px; }
  .pub-chips { gap: 4px; }
  .pub-chip { font-size: 10px; padding: 2px 8px; }

  .section-head { margin: 44px 0 16px; }
  .research-grid { gap: 14px; }
  .research-card { padding: 22px 22px; }
}
