/* UNH Nuclear & Particle Physics Group -- site stylesheet */

:root {
  --navy: #0b1f44;
  --blue: #003591;          /* UNH blue */
  --blue-600: #1a4fb0;
  --accent: #2b9fd8;        /* from the original NPG logo */
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #e2e6ee;
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .08);
  --container: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); text-underline-offset: 2px; }
a:hover { color: var(--blue); }
h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -.01em; margin-top: 0; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1em; }
sup, sub { line-height: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 31, 68, .96);
  backdrop-filter: saturate(140%) blur(8px);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-unh { font-size: .75rem; letter-spacing: .18em; font-weight: 700; color: var(--accent); }
.brand-name { font-weight: 650; font-size: 1.02rem; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: 4px; }
.site-nav li { position: relative; }
.site-nav a {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: rgba(255,255,255,.88); text-decoration: none; font-weight: 550; font-size: .98rem;
}
.site-nav a:hover, .site-nav li.active > a { color: #fff; background: rgba(255,255,255,.08); }
.site-nav li.active > a { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.site-nav .sub {
  position: absolute; left: 0; top: 100%; min-width: 280px; padding: 8px;
  background: #fff; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s ease;
}
.site-nav .sub a { color: var(--ink); font-weight: 500; border-radius: 6px; }
.site-nav .sub a:hover, .site-nav .sub a[aria-current] { background: var(--bg-soft); color: var(--blue); box-shadow: none; }
.site-nav .has-sub:hover > .sub, .site-nav .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.sub-toggle { display: none; }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: #fff; transition: .2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .brand-name { font-size: .92rem; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy); border-top: 1px solid rgba(255,255,255,.08);
    display: none; padding: 8px 16px 16px;
  }
  .site-nav.open { display: block; }
  .site-nav > ul { flex-direction: column; }
  .site-nav li.active > a { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0; }
  .site-nav .sub {
    position: static; opacity: 1; visibility: visible; transform: none; display: none;
    background: transparent; box-shadow: none; padding: 0 0 0 16px; min-width: 0;
  }
  .site-nav .sub a { color: rgba(255,255,255,.8); }
  .site-nav .sub a:hover, .site-nav .sub a[aria-current] { background: rgba(255,255,255,.08); color: #fff; }
  .site-nav .has-sub.open > .sub { display: block; }
  .site-nav .has-sub { display: flex; flex-wrap: wrap; }
  .site-nav .has-sub > a { flex: 1; }
  .sub-toggle {
    display: block; width: 44px; background: none; border: 0; cursor: pointer; color: #fff;
  }
  .sub-toggle::before { content: "▾"; font-size: 1.1rem; }
  .has-sub.open > .sub-toggle::before { content: "▴"; }
  .site-nav .has-sub > .sub { flex-basis: 100%; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; isolation: isolate;
  background: var(--navy) center / cover no-repeat;
  min-height: min(72vh, 620px); display: flex; align-items: flex-end;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(11,31,68,.85) 0%, rgba(11,31,68,.55) 45%, rgba(11,31,68,0) 75%),
    linear-gradient(180deg, rgba(11,31,68,.1) 0%, rgba(11,31,68,.45) 60%, rgba(11,31,68,.9) 100%);
}
.hero .container { padding-top: 120px; padding-bottom: 56px; }
.hero h1 { color: #fff; max-width: 18ch; font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: .3em; }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 60ch; color: rgba(255,255,255,.9); }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.hero .eyebrow { color: #8fd3f4; }

.page-hero {
  position: relative; color: #fff; isolation: isolate;
  background: var(--navy) center / cover no-repeat;
  padding: 88px 0 44px;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(11,31,68,.55), rgba(11,31,68,.9));
}
.page-hero.plain { background: linear-gradient(135deg, var(--navy), var(--blue)); padding: 64px 0 40px; }
.page-hero.plain::before { display: none; }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero p { color: rgba(255,255,255,.85); margin: .6em 0 0; max-width: 65ch; font-size: 1.1rem; }
.breadcrumb { font-size: .9rem; margin-bottom: .8em; }
.breadcrumb a { color: rgba(255,255,255,.8); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: #fff; border: 2px solid var(--accent); transition: .15s;
}
.btn:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.6); }
.btn.ghost:hover { background: #fff; color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section.soft { background: var(--bg-soft); }
.section > .container > h2:first-child, .section-head h2 { margin-top: 0; }
.section-head { max-width: 70ch; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .split, .split.even { grid-template-columns: 1fr; gap: 32px; } }

.prose { max-width: 75ch; }
.prose li { margin-bottom: .45em; }

.figure { margin: 0 0 1.5em; }
.figure img { border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.figure figcaption { font-size: .92rem; color: var(--muted); margin-top: .7em; line-height: 1.5; }
.figure.plain img { box-shadow: none; border: 1px solid var(--line); }
.float-right { float: right; width: min(420px, 45%); margin: .3em 0 1em 2em; }
@media (max-width: 700px) { .float-right { float: none; width: 100%; margin: 1em 0; } }
.clear { clear: both; }

.stack-imgs { display: grid; gap: 20px; }
.stack-imgs img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
a.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(16,24,40,.14); color: inherit; }
.card-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg-soft); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 0 0 .4em; }
.card-body p { color: var(--muted); font-size: .98rem; margin: 0; }
.card-more { margin-top: auto; padding-top: 14px; font-weight: 600; color: var(--blue-600); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 32px 0 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat b { display: block; font-size: 2rem; color: var(--blue); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .92rem; }

/* ---------- People ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.person { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.person img { aspect-ratio: 4 / 5; object-fit: cover; object-position: top; width: 100%; }
.person .avatar {
  aspect-ratio: 4 / 5; display: grid; place-items: center; font-size: 3rem; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--blue), var(--accent));
}
.person-body { padding: 16px 20px 20px; }
.person h3 { margin: 0; font-size: 1.15rem; }
.person .role { color: var(--accent); font-weight: 600; font-size: .9rem; margin: .2em 0 .6em; }
.person p { font-size: .95rem; color: var(--muted); margin: 0; }
.person-links { margin-top: 10px; font-size: .92rem; }

.person-row { display: grid; grid-template-columns: 220px 1fr; gap: 36px; padding: 36px 0; border-top: 1px solid var(--line); }
.person-row:first-of-type { border-top: 0; }
.person-row img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 5; object-fit: cover; object-position: top; width: 100%; }
.person-row h3 { margin: 0; font-size: 1.5rem; }
.person-row .role { color: var(--accent); font-weight: 650; margin: .2em 0 .8em; }
@media (max-width: 700px) { .person-row { grid-template-columns: 1fr; gap: 16px; } .person-row img { max-width: 220px; } }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.chip b { display: block; color: var(--navy); }
.chip span { color: var(--muted); font-size: .92rem; }

table.alumni { width: 100%; border-collapse: collapse; font-size: .96rem; margin-bottom: 2em; }
table.alumni th, table.alumni td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.alumni th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
table.alumni td:first-child { font-weight: 600; white-space: nowrap; color: var(--navy); }
table.alumni tr:hover td { background: var(--bg-soft); }
@media (max-width: 640px) {
  table.alumni thead { display: none; }
  table.alumni tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.alumni td { display: block; border: 0; padding: 2px 0; white-space: normal !important; }
}

details.disclose { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; background: #fff; margin-bottom: 16px; }
details.disclose summary { cursor: pointer; padding: 16px 0; font-weight: 650; color: var(--navy); font-size: 1.1rem; }
details.disclose[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

/* ---------- Misc ---------- */
.callout { border-left: 4px solid var(--accent); background: var(--bg-soft); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; }
.callout p:last-child { margin: 0; }
.equation { overflow-x: auto; padding: .4em 0; margin: 0 0 1em; }
ol.refs { font-size: .92rem; color: var(--muted); padding-left: 1.6em; }
ol.refs li { margin-bottom: .3em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 2em; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); text-decoration: none; font-weight: 550; font-size: .94rem; }
.toc a:hover { background: #fff; border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.75); font-size: .95rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.footer-title { color: #fff; font-size: 1rem; margin: 0 0 .8em; }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; padding-bottom: 24px; font-size: .85rem; color: rgba(255,255,255,.55); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .hero::before, .page-hero::before { display: none; }
  .hero, .page-hero { color: #000; background: none !important; min-height: 0; }
  .hero h1, .page-hero h1 { color: #000; }
}
