/* ==========================================================================
   CEDMAV site styles. Colors and fonts are defined once, here:
   ========================================================================== */
:root {
  --navy: #0b1f3a;
  --navy-2: #13325c;
  --accent: #be0000;          /* University of Utah red */
  --accent-dark: #8f0000;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f5f7fa;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .08), 0 12px 32px rgba(15, 23, 42, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1160px;
  --narrow: 760px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65;
  color: var(--text); background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.5vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: var(--narrow); }
.muted { color: var(--muted); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46em; }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .6em;
}
.eyebrow a { color: inherit; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.button {
  display: inline-block; background: var(--accent); color: var(--white);
  padding: .7em 1.3em; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 2px solid var(--accent); transition: background .15s, border-color .15s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); text-decoration: none; }
.button-ghost { background: transparent; border-color: rgba(255,255,255,.5); }
.button-ghost:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; letter-spacing: .04em; }
.brand-text small { font-size: .72rem; color: var(--muted); }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 8px;
  color: var(--ink); font-weight: 500; font-size: .95rem;
}
.site-nav a:hover { background: var(--soft); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); }
.ext { font-size: .8em; color: var(--muted); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 820px) {
  .brand-text small { display: none; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #cbd5e1;
  background:
    radial-gradient(circle at 85% 20%, rgba(190,0,0,.35), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(56,120,220,.25), transparent 45%),
    linear-gradient(135deg, var(--navy), var(--navy-2));
}
.hero::before {   /* subtle dot grid */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero-inner { position: relative; padding: 110px 24px 120px; }
.hero h1 { color: var(--white); max-width: 16em; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.hero .lead { color: #cbd5e1; font-size: clamp(1.1rem, 2vw, 1.3rem); }
.eyebrow-light { color: #fca5a5; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2em; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-soft { background: var(--soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }

.page-header { background: var(--soft); border-bottom: 1px solid var(--line); padding: 64px 0 48px; }
.page-header h1 { margin-bottom: .3em; }
.page-header .lead { margin: 0; }
.page-body { padding: 48px 24px 88px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-media {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10; background: #eef2f6; border-bottom: 1px solid var(--line);
}
.card-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.card-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.card-placeholder img { width: 64px; height: 64px; padding: 0; opacity: .9; }
.card-body { padding: 20px 22px 24px; }
.card-body h3 { margin-bottom: .45em; }
.card-body h3 a { color: var(--ink); }
.card-body p:last-child { margin: 0; font-size: .95rem; color: var(--muted); }

/* ---------- Home feature ---------- */
.feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.feature-media img { border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } }

/* ---------- People ---------- */
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--white);
  font-weight: 600; font-size: 1.5rem; letter-spacing: .04em;
}
.people-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 24px; }
.people-chip { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.people-chip:hover { text-decoration: none; color: var(--accent); }
.people-group { margin-bottom: 56px; }
.people-group h2 { padding-bottom: .4em; border-bottom: 1px solid var(--line); margin-bottom: 1.2em; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px 36px; }
.person { display: flex; gap: 18px; align-items: center; }
.person h3 { margin: 0 0 .2em; }
.person h3 a { color: var(--ink); }
.person h3 a:hover { color: var(--accent); }
.person p { margin: 0; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.people-grid-compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.people-grid-compact .avatar { width: 52px; height: 52px; font-size: 1rem; }
.people-grid-compact h3 { font-size: 1rem; font-weight: 500; }

/* ---------- Research page ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }
.chips a {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: .9rem; font-weight: 500; background: var(--white);
}
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.area { margin-bottom: 64px; scroll-margin-top: 90px; }

/* ---------- News list ---------- */
.news-year h2 { font-size: 1.3rem; color: var(--muted); margin: 0 0 16px; }
.news-year { margin-bottom: 40px; }
.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { border-bottom: 1px solid var(--line); }
.news-item { display: flex; gap: 24px; padding: 20px 8px; color: var(--text); border-radius: 8px; }
.news-item:hover { text-decoration: none; background: var(--soft); }
.news-item:hover strong { color: var(--accent); }
.news-thumb {
  position: relative; flex: none; width: 160px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  background: #eef2f6;
}
.news-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-thumb img.logo-thumb { inset: 25% 35%; width: 30%; height: 50%; object-fit: contain; }
.news-text { display: flex; flex-direction: column; gap: 4px; }
.news-text time { font-size: .85rem; color: var(--muted); }
.news-text strong { color: var(--ink); font-size: 1.08rem; line-height: 1.35; }
.news-blurb { font-size: .93rem; color: var(--muted); }
@media (max-width: 600px) { .news-thumb { width: 96px; } .news-blurb { display: none; } }

/* ---------- Events ---------- */
.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li { display: flex; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.event-year { font-weight: 700; color: var(--accent); font-size: 1.2rem; min-width: 3.5em; }
.event-list h3 { margin: 0 0 .2em; }
.event-list h3 a { color: var(--ink); }
.event-list p { margin: 0; color: var(--muted); }

/* ---------- Articles (news / project / event pages) ---------- */
.article { padding: 56px 0 88px; }
.article-header h1 { margin-bottom: .4em; font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.article-hero { margin: 32px auto; }
.article-hero img { display: block; margin: 0 auto; max-height: 480px; width: auto; border-radius: var(--radius); }
.prose { font-size: 1.06rem; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3, .prose h4 { margin-top: 1.6em; }
.prose img { display: block; margin: 28px auto; border-radius: 8px; }
.prose em > img, .prose p > img:only-child { margin: 28px auto; }
.prose blockquote { margin: 1.5em 0; padding: .2em 1.2em; border-left: 4px solid var(--accent); color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; text-align: left; }
.prose td img { margin: 0; }
.prose video { display: block; width: 100%; border-radius: 8px; margin: 28px 0; }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 28px 0; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.article-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.article-nav a { display: flex; flex-direction: column; max-width: 48%; color: var(--ink); font-weight: 600; line-height: 1.35; }
.article-nav a.right { text-align: right; margin-left: auto; }
.article-nav small { color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.back { margin-top: 48px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #94a3b8; padding: 64px 0 0; font-size: .95rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.site-footer h2 { color: var(--white); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5em; }
.brand-footer, .brand-footer:hover { color: var(--white); margin-bottom: 14px; }
.brand-footer img { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.footer-about { max-width: 26em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding: 22px 24px; font-size: .85rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; margin: 1.5em 0; }
.table-wrap table { margin: 0; }

/* ---------- Profile pages ---------- */
.profile-header { display: flex; gap: 32px; align-items: center; margin: 8px 0 40px; }
.profile-photo { width: 168px; height: 168px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: var(--shadow); }
.profile-header h1 { margin-bottom: .25em; }
.profile-role { margin: 0; color: var(--muted); font-size: 1.05rem; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; font-weight: 600; font-size: .95rem; }
.profile-section { margin-bottom: 36px; }
.profile-section h2 { font-size: 1.25rem; padding-bottom: .4em; border-bottom: 1px solid var(--line); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: .9rem; color: var(--ink); }
.plain-list { padding-left: 1.2em; margin: 0; }
.plain-list li { margin-bottom: .4em; }
.person-linked h3 a::after { content: " →"; color: var(--accent); }
@media (max-width: 600px) { .profile-header { flex-direction: column; align-items: flex-start; } .profile-photo { width: 128px; height: 128px; } }

/* ---------- Events ---------- */
.events-section { margin-bottom: 56px; }
.events-section > h2 { padding-bottom: .4em; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.events-year { color: var(--muted); font-size: 1.1rem; margin: 28px 0 14px; }
.event-list { display: flex; flex-direction: column; gap: 18px; }
.event-card {
  display: flex; gap: 24px; align-items: flex-start; padding: 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.event-date {
  flex: none; width: 76px; text-align: center; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--white);
}
.event-date .m { display: block; background: var(--accent); color: var(--white); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; }
.event-date .d { display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.2; padding-top: 6px; }
.event-date .y { display: block; font-size: .8rem; color: var(--muted); padding-bottom: 6px; }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { margin: .2em 0 .3em; font-size: 1.15rem; }
.event-body h3 a { color: var(--ink); }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .85rem; color: var(--muted); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; background: var(--navy); color: var(--white); }
.badge-soft { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.event-location { margin: 0 0 .4em; font-size: .92rem; color: var(--text); }
.event-summary { margin: 0; font-size: .93rem; color: var(--muted); }
.event-link { margin: .6em 0 0; font-size: .9rem; font-weight: 600; }
.event-thumb { flex: none; width: 200px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #eef2f6; }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-list-past .event-card { box-shadow: none; }
.event-list-past .event-date .m { background: var(--muted); }
.event-facts { list-style: none; padding: 0; margin: 0 0 1.2em; color: var(--text); }
.event-facts li { margin-bottom: .3em; }
.event-facts strong { display: inline-block; min-width: 4.5em; color: var(--ink); }
@media (max-width: 720px) { .event-thumb { display: none; } .event-card { gap: 16px; padding: 16px; } .event-date { width: 62px; } }

/* ---------- Publications ---------- */
.pub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat-value { display: block; font-size: 2.1rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.stat-label { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.chart-card { margin: 0 0 56px; padding: 24px 24px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.chart-card h2 { font-size: 1.2rem; margin: 0; }
.chart-card figcaption p { margin: 2px 0 18px; font-size: .9rem; }
.bar-chart { position: relative; height: 240px; padding-left: 44px; }
.bar-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.bar-grid span { border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); line-height: 0; padding-top: 0; }
.bar-grid span:last-child { border-top-color: #cbd5e1; }
.bars { position: absolute; left: 44px; right: 0; top: 0; bottom: 0; display: flex; align-items: stretch; gap: 2px; }
.bar-col { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 24px; outline: none; cursor: default; }
.bar { background: var(--navy-2); border-radius: 4px 4px 0 0; min-height: 2px; transition: background .15s; }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--accent); }
.bar-label { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bar-tip {
  position: absolute; bottom: calc(100% - 12px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--white); font-size: .78rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 2;
}
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { opacity: 1; }
.chart-table { margin-top: 12px; font-size: .85rem; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { border-collapse: collapse; margin-top: 8px; }
.chart-table td, .chart-table th { padding: 2px 14px 2px 0; text-align: left; }
.pub-section { margin-bottom: 64px; }
.pub-section > h2 { padding-bottom: .4em; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.theme-card { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--text); transition: box-shadow .2s, transform .2s; }
.theme-card:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-2px); color: var(--text); }
.theme-img { flex: none; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; background: #eef2f6; }
.theme-img img { width: 100%; height: 100%; object-fit: cover; }
.theme-text strong { display: block; color: var(--ink); margin-bottom: 4px; }
.theme-text span { display: block; font-size: .87rem; color: var(--muted); line-height: 1.45; }
.pub-year { color: var(--muted); font-size: 1.05rem; margin: 26px 0 8px; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub { padding: 14px 0 14px 18px; border-left: 3px solid var(--line); margin-bottom: 6px; }
.pub:hover { border-left-color: var(--accent); }
.pub-title { display: block; color: var(--ink); font-weight: 600; line-height: 1.4; }
.pub-authors, .pub-venue { display: block; font-size: .9rem; color: var(--muted); }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { font-style: italic; }
.pub-cites { font-style: normal; color: var(--accent); font-weight: 600; }
.theme-block { margin-bottom: 44px; scroll-margin-top: 90px; }
.theme-head { display: flex; gap: 22px; align-items: center; padding: 18px; background: var(--soft); border-radius: var(--radius); margin-bottom: 12px; }
.theme-head img { width: 140px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; background: var(--white); }
.theme-head h3 { margin: 0 0 .25em; font-size: 1.25rem; }
.theme-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 32px; border-radius: var(--radius); color: #cbd5e1;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.cta-band h2 { color: var(--white); margin: 0 0 .2em; font-size: 1.4rem; }
.cta-band p { margin: 0; }
@media (max-width: 600px) { .theme-head { flex-direction: column; align-items: flex-start; } .bar-chart { padding-left: 36px; } .bars { left: 36px; } }

/* ---------- Software ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.software-card .card-body p:last-child { margin: 0; }
.software-card .card-body > p:not(.tag-row):not(.software-links) { font-size: .95rem; color: var(--muted); }
.install { display: block; background: var(--navy); color: #e2e8f0; padding: 8px 12px; border-radius: 6px; font-size: .85rem; margin: 0 0 12px; }
.software-links { display: flex; gap: 18px; font-weight: 600; font-size: .92rem; }
.software-links a { color: var(--accent) !important; }

/* ---------- Home additions ---------- */
.pillars-section { padding-bottom: 40px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.pillar { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); }
.pillar-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--white); font-size: 1.3rem; margin-bottom: 14px; }
.pillar h2 { font-size: 1.3rem; margin-bottom: .35em; }
.pillar p { color: var(--muted); font-size: .97rem; }
.pillar a { font-weight: 600; }
@media (max-width: 640px) { .pillars { grid-template-columns: 1fr; } }
.impact { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #cbd5e1; padding: 56px 0; }
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; text-align: center; }
.impact-value { display: block; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; color: var(--white); letter-spacing: -.02em; }
.impact-label { display: block; font-size: .9rem; margin-top: 4px; }
@media (max-width: 820px) { .impact-grid { grid-template-columns: repeat(2, 1fr); } }
.partners { padding: 56px 0 72px; text-align: center; }
.partner-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.partner-list li { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .92rem; background: var(--white); }

/* ---------- Profile extras ---------- */
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 36px; }
.profile-stats .stat { padding: 16px 18px; }
.profile-stats .stat-value { font-size: 1.7rem; }
.profile-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.profile-projects .theme-img { width: 84px; height: 84px; }
/* ---------- Funding ---------- */
.funding-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.grant { display: flex; gap: 18px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.grant-sponsor { flex: none; min-width: 76px; text-align: center; padding: 6px 10px; border-radius: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .03em; color: var(--white); background: var(--navy); }
.grant-sponsor.sponsor-nsf { background: var(--navy-2); }
.grant-sponsor.sponsor-doe { background: #334155; }
.grant-sponsor.sponsor-arpa-h { background: var(--accent); }
.grant-sponsor.sponsor-industry { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.grant-body h3 { font-size: 1.02rem; margin: 0 0 .3em; line-height: 1.4; }
.grant-body h3 a { color: var(--ink); }
.grant-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: .87rem; color: var(--muted); }
.grant-meta span + span::before { content: "·"; margin-right: 14px; color: var(--line); }
.grant-role { margin: .3em 0 0; font-size: .9rem; color: var(--text); }
@media (max-width: 600px) { .grant { flex-direction: column; gap: 8px; } }

/* ==========================================================================
   Visual layer: animated contours, dark page headers, reveal & hover effects
   ========================================================================== */
canvas.contours { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

.hero { min-height: min(78vh, 720px); display: flex; align-items: center; }
.hero::before { z-index: 0; }
.hero-inner { z-index: 1; width: 100%; }
.hero h1 { text-shadow: 0 2px 24px rgba(11, 31, 58, .5); }
.hero-accent {
  background: linear-gradient(90deg, #ffffff 0%, #fca5a5 45%, #ef4444 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero::after {   /* soft fade into the page */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(to bottom, transparent, rgba(11, 31, 58, .35));
  pointer-events: none;
}

.page-header {
  position: relative; overflow: hidden; border-bottom: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(190, 0, 0, .35), transparent 45%),
    linear-gradient(135deg, var(--navy), var(--navy-2));
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { color: var(--white); }
.page-header .lead { color: #cbd5e1; }

/* Section titles get a small accent bar */
.section-head h2, .pub-section > h2, .events-section > h2, .people-group h2, .area h2 { position: relative; }
.section-head h2::after {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; margin-top: 10px;
  background: linear-gradient(90deg, var(--accent), #f87171);
}

/* Cards: image zoom + gradient accent on hover */
.card { position: relative; }
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #f87171, var(--navy-2));
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.card:hover::after { transform: scaleX(1); }
.card-media > img { transition: transform .5s ease; }
.card:hover .card-media > img { transform: scale(1.06); }
.feature-media img { transition: transform .6s ease, box-shadow .6s ease; }
.feature:hover .feature-media img { transform: scale(1.02); box-shadow: var(--shadow-hover); }
.pillar { transition: transform .25s ease, box-shadow .25s ease; }
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.people-chip .avatar { transition: transform .3s ease, box-shadow .3s ease; }
.people-chip:hover .avatar { transform: scale(1.08); box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent); }
.grant { transition: border-color .2s ease, box-shadow .2s ease; }
.grant:hover { border-color: #cbd5e1; box-shadow: var(--shadow); }

/* Impact band: glow */
.impact { position: relative; overflow: hidden; }
.impact::before {
  content: ""; position: absolute; inset: -40% -10%;
  background: radial-gradient(circle at 20% 50%, rgba(190, 0, 0, .25), transparent 40%),
              radial-gradient(circle at 80% 50%, rgba(56, 120, 220, .25), transparent 40%);
  pointer-events: none;
}
.impact-grid { position: relative; }
.impact-value { font-variant-numeric: tabular-nums; }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .card-media > img, .feature-media img, .pillar, .people-chip .avatar { transition: none; }
}

/* Hero legend for the live Morse-Smale complex */
.hero-legend {
  position: absolute; right: 24px; bottom: 18px; z-index: 1; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 14px; border-radius: 999px; font-size: .75rem; color: #cbd5e1;
  background: rgba(11, 31, 58, .55); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
}
.hero-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hero-legend .lg-title { color: #94a3b8; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.lg-max { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.lg-min { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.lg-saddle { background: #fff; border-radius: 1px; transform: rotate(45deg) scale(.85); }
.lg-line { width: 18px; height: 2px; border-radius: 1px; background: #fca5a5; }
@media (max-width: 820px) { .hero-legend { display: none; } }

/* ---------- Dark top bar (matches hero and page headers) ---------- */
.site-header { background: rgba(11, 31, 58, .97); border-bottom: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 4px 20px rgba(11, 31, 58, .18); }
.site-header .brand, .site-header .brand:hover { color: var(--white); }
.site-header .brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.site-header .brand-text small { color: #94a3b8; }
.site-nav a { color: #e2e8f0; }
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
.site-nav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.site-nav .ext { color: #94a3b8; }
.nav-toggle span { background: var(--white); }
@media (max-width: 820px) {
  .site-nav { background: var(--navy); border-bottom-color: rgba(255, 255, 255, .08); }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
}

/* ---------- Small-screen fixes ---------- */
.prose a, .prose td, .pub-title, .grant-body h3 { overflow-wrap: anywhere; }
.bar-col:nth-child(-n+3) .bar-tip { left: 0; transform: none; }
.bar-col:nth-last-child(-n+4) .bar-tip { left: auto; right: 0; transform: none; }
.event-date .d-year { font-size: 1.1rem; padding: 10px 0 10px; }
.pub-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pillars { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@media (max-width: 600px) {
  .bar-label-minor, .bar-label-edge { display: none; }
  .grant-meta span + span::before { content: none; }
  .grant-meta { gap: 2px 12px; }
  .stat-value { font-size: 1.7rem; }
}

/* ==========================================================================
   Dark image tiles (cards, theme cards, featured papers)
   ========================================================================== */
.card {
  background: linear-gradient(180deg, #112a4d 0%, var(--navy) 100%);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 6px 24px rgba(11, 31, 58, .18);
  color: #cbd5e1;
}
.card:hover { box-shadow: 0 0 0 1px rgba(239, 68, 68, .45), 0 18px 40px rgba(11, 31, 58, .35); }
.card-media { aspect-ratio: 16 / 10; background: var(--navy); border-bottom: 0; }
.card-media > img { object-fit: cover; padding: 0; }
.card-media::after {     /* blend the picture into the tile */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 31, 58, 0) 55%, rgba(17, 42, 77, .95) 100%);
  pointer-events: none;
}
.card-body h3 a { color: var(--white); }
.card-body h3 a:hover { color: #fecaca; }
.card-body .eyebrow { color: #fca5a5; }
.card-body p:last-child, .software-card .card-body > p:not(.tag-row):not(.software-links) { color: #94a3b8; }
.card .badge-soft { background: rgba(255, 255, 255, .08); color: #e2e8f0; border-color: rgba(255, 255, 255, .14); }
.card .install { background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .08); }
.software-links a { color: #fca5a5 !important; }

.theme-card { background: linear-gradient(135deg, #112a4d, var(--navy)); border-color: rgba(255, 255, 255, .06); color: #cbd5e1; }
.theme-card:hover { color: #cbd5e1; box-shadow: 0 0 0 1px rgba(239, 68, 68, .45), 0 14px 32px rgba(11, 31, 58, .3); }
.theme-text strong { color: var(--white); }
.theme-text span { color: #94a3b8; }
.theme-img { background: var(--navy-2); }

/* Featured papers: figure fills the tile, title over a gradient */
.paper-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.paper-tile {
  position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--navy); box-shadow: 0 6px 24px rgba(11, 31, 58, .2); color: var(--white);
}
.paper-tile:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.paper-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.paper-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 31, 58, 0) 35%, rgba(11, 31, 58, .55) 60%, rgba(11, 31, 58, .96) 100%);
}
.paper-tile-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 18px 20px; display: block; }
.paper-tile-text .eyebrow { color: #fca5a5; margin-bottom: .35em; }
.paper-tile-text strong { display: block; font-size: 1.02rem; line-height: 1.35; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.paper-tile:first-child .paper-tile-text strong { font-size: 1.45rem; }
.paper-tile:hover { text-decoration: none; color: var(--white); box-shadow: 0 0 0 2px var(--accent), 0 18px 40px rgba(11, 31, 58, .35); }
.paper-tile:hover img { transform: scale(1.06); }
.pub-oa { font-style: normal; font-weight: 600; }
@media (max-width: 640px) { .paper-tile:first-child { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; } }
.paper-tile::after { background: linear-gradient(180deg, rgba(11, 31, 58, 0) 25%, rgba(11, 31, 58, .7) 55%, rgba(11, 31, 58, .97) 100%); }
/* fill the last row when the big first tile leaves a gap (e.g. 8 papers) */
.paper-tile:last-child:nth-child(3n+2) { grid-column: span 2; aspect-ratio: auto; }
@media (max-width: 640px) { .paper-tile:last-child:nth-child(3n+2) { grid-column: auto; aspect-ratio: 4 / 3; } }

/* ==========================================================================
   Projects page
   ========================================================================== */
/* Sponsor colors (validated categorical palette, slots 1-6) */
.sponsor-nsf { --sp: #257de0; } .sponsor-doe { --sp: #f47230; } .sponsor-arpa-h { --sp: #00b894; }
.sponsor-nih { --sp: #f2a600; } .sponsor-industry { --sp: #ee7fac; } .sponsor-state-of-utah { --sp: #008a17; }
.grant-sponsor { background: var(--sp, var(--navy)) !important; color: var(--white) !important; border: 0 !important; }

/* Current projects: image tiles */
.project-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.project-tile {
  position: relative; display: block; min-height: 300px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #112a4d, var(--navy)); color: var(--white); box-shadow: 0 6px 24px rgba(11, 31, 58, .2);
}
.project-tile:first-child { grid-column: span 2; min-height: 380px; }
.project-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.project-tile::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 31, 58, .1) 0%, rgba(11, 31, 58, .65) 45%, rgba(11, 31, 58, .97) 100%); }
.project-tile-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 20px 22px; display: block; }
.project-tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .85rem; color: #cbd5e1; margin-bottom: 8px; }
.project-tile-meta .grant-sponsor { min-width: 0; padding: 3px 10px; font-size: .75rem; }
.project-amount { font-weight: 700; color: var(--white); }
.project-tile strong { display: block; font-size: 1.1rem; line-height: 1.35; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.project-tile:first-child strong { font-size: 1.5rem; }
.project-role { display: block; margin-top: 6px; font-size: .88rem; color: #cbd5e1; }
.project-tile:hover { text-decoration: none; color: var(--white); box-shadow: 0 0 0 2px var(--accent), 0 18px 40px rgba(11, 31, 58, .35); }
.project-tile:hover img { transform: scale(1.06); }
@media (max-width: 760px) { .project-tile:first-child { grid-column: auto; } }

/* Timeline (Gantt) */
.timeline-card figcaption p { margin: 0 0 10px; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--text); }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; background: var(--sp); display: inline-block; }
.gantt { --label: 34%; position: relative; margin-top: 14px; }
.gantt-axis { position: relative; height: 22px; margin-left: var(--label); border-bottom: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.gantt-axis span { position: absolute; bottom: 4px; transform: translateX(-50%); }
.gantt-now { color: var(--accent) !important; font-weight: 700; }
.gantt-nowline { position: absolute; top: 22px; bottom: 0; width: 1px; background: rgba(190, 0, 0, .4); left: calc(var(--label) + (100% - var(--label)) * var(--x)); pointer-events: none; }
.gantt-bar.tip-left .gantt-tip { left: auto; right: 0; }
.gantt-group { margin: 14px 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.gantt-row { display: flex; align-items: center; height: 24px; }
.gantt-row:hover { background: var(--soft); }
.gantt-label { flex: none; width: var(--label); padding-right: 12px; font-size: .8rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { position: relative; flex: 1; height: 100%;
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(15.625% - 1px), var(--line) calc(15.625% - 1px), var(--line) 15.625%); }
.gantt-bar { position: absolute; top: 6px; height: 12px; min-width: 6px; border-radius: 4px; background: var(--sp); outline: none; }
.gantt-bar.is-current { box-shadow: 0 0 0 2px rgba(255, 255, 255, 1), 0 0 10px var(--sp); }
.gantt-bar:hover, .gantt-bar:focus { filter: brightness(1.1); box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--sp); }
.gantt-tip {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; width: max-content; max-width: 320px;
  background: var(--ink); color: var(--white); font-size: .78rem; line-height: 1.4; padding: 8px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .12s; white-space: normal;
}
.gantt-bar:hover .gantt-tip, .gantt-bar:focus .gantt-tip { opacity: 1; }
@media (max-width: 640px) {
  .gantt { --label: 0%; }
  .gantt-label { display: none; }
  .gantt-axis span:nth-child(even) { display: none; }
}
.project-tiles { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.paper-tiles { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.gantt { overflow-x: clip; overflow-y: visible; }
.gantt-tip { max-width: min(320px, 70vw); }
/* current projects: 2 large tiles on top, then 4 across (12-column grid) */
.project-tiles { grid-template-columns: repeat(12, 1fr); }
.project-tile, .project-tile:first-child { grid-column: span 3; min-height: 300px; }
.project-tile:nth-child(-n+2) { grid-column: span 6; min-height: 360px; }
.project-tile:first-child strong { font-size: 1.1rem; }
.project-tile:nth-child(-n+2) strong { font-size: 1.4rem; }
@media (max-width: 1000px) { .project-tile, .project-tile:first-child, .project-tile:nth-child(-n+2) { grid-column: span 6; } }
@media (max-width: 640px) { .project-tile, .project-tile:first-child, .project-tile:nth-child(-n+2) { grid-column: span 12; min-height: 280px; } }
/* timeline axis: "today" label sits above the year ticks */
.gantt-axis { height: 38px; }
.gantt-now { bottom: 20px !important; }
.gantt-nowline { top: 38px; }
.gantt-axis span:first-child { transform: none; }
@media (max-width: 640px) { .gantt-axis span.gantt-now { display: block; } }

/* Past projects: picture tiles */
.pcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 16px; margin-bottom: 12px; }
.pcard {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #112a4d 0%, var(--navy) 100%); color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 6px 20px rgba(11, 31, 58, .16);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(239, 68, 68, .45), 0 16px 36px rgba(11, 31, 58, .3); }
.pcard-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--sp, var(--navy-2)), var(--navy)); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pcard:hover .pcard-media img { transform: scale(1.06); }
.pcard-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 31, 58, 0) 55%, rgba(17, 42, 77, .9) 100%); }
.pcard-media .grant-sponsor { position: absolute; top: 10px; left: 10px; z-index: 1; min-width: 0; padding: 3px 10px; font-size: .72rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.pcard-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: rgba(255, 255, 255, .35); letter-spacing: .05em; }
.pcard-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard-meta { margin: 0; display: flex; gap: 12px; font-size: .8rem; color: #94a3b8; }
.pcard-body h3 { margin: 0; font-size: .98rem; line-height: 1.35; color: var(--white); }
.pcard-body h3 a { color: var(--white); }
.pcard-body h3 a:hover { color: #fecaca; }
.pcard-role { margin: 0; font-size: .84rem; color: #cbd5e1; }
.pcard-award { margin: auto 0 0; padding-top: 4px; font-size: .76rem; color: #94a3b8; }
.pcard-award a { color: #fca5a5; }
