/* EP2 website — single stylesheet, no framework.
   Palette: EP² logo gold, plasma-plume teal, charcoal (from the original site). */

:root {
  --gold: #e89a05;
  --gold-dark: #b87700;
  --teal: #109090;
  --teal-light: #80d0d0;
  --charcoal: #1e2326;
  --charcoal-2: #2a3034;

  --bg: #ffffff;
  --bg-alt: #f3f5f5;
  --surface: #ffffff;
  --text: #22282b;
  --muted: #5d676c;
  --border: #dde3e4;
  --link: #0b7777;
  --link-hover: var(--gold-dark);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);

  --radius: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191b;
    --bg-alt: #1b2023;
    --surface: #20262a;
    --text: #e4e9ea;
    --muted: #a3afb3;
    --border: #2f373b;
    --link: var(--teal-light);
    --link-hover: #f3b53c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.icon { width: 1.1em; height: 1.1em; vertical-align: -.18em; }

/* ---------- Preview banner (temporary builds only) ---------- */
.preview-banner { background: var(--gold); color: #1a1a1a; text-align: center; font-size: .88rem; font-weight: 600; padding: 6px var(--gutter); }
.preview-banner a { color: #1a1a1a; }
.preview-banner ~ .site-header.is-overlay { top: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--charcoal); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header.is-overlay { position: absolute; left: 0; right: 0; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 84px; height: auto; }
.brand-text { font-size: .78rem; line-height: 1.2; color: #c9d1d3; text-transform: uppercase; letter-spacing: .06em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a { display: block; padding: 8px 12px; color: #e8ecec; text-decoration: none; border-radius: 6px; font-weight: 500; font-size: .98rem; }
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: transform .2s, opacity .2s; }

@media (max-width: 860px) {
  .brand-text { display: none; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--charcoal); display: none; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .site-nav a { padding: 12px 8px; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.06); border-radius: 0; }
  .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); }
  .site-header.is-overlay .site-nav { background: rgba(20,24,26,.97); }
}

/* ---------- Heroes ---------- */
.home-hero {
  position: relative; color: #fff; min-height: min(88vh, 760px); display: flex; align-items: flex-end;
  background: #05090b url("../img/hero-plume.webp") left center / cover no-repeat;
  padding: 120px 0 64px;
}
.home-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.5), rgba(0,0,0,.05) 70%), linear-gradient(transparent 60%, rgba(0,0,0,.5)); }
.home-hero .wrap { position: relative; z-index: 1; width: 100%; }
.home-hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.8rem); max-width: 14em; }
.home-hero h1 span { color: var(--gold); }
.home-hero .lead { color: #d6dfe1; max-width: 38em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--teal-light); font-weight: 600; margin-bottom: .8em; }
.page-hero {
  color: #fff; padding: clamp(40px, 7vw, 80px) 0 clamp(32px, 5vw, 56px);
  background: linear-gradient(100deg, rgba(20,24,26,.96), rgba(20,24,26,.75)), var(--hero-img, none) center / cover, var(--charcoal);
  border-bottom: 3px solid var(--gold);
}
.page-hero .lead { color: #cfd8da; margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid transparent; }
.btn-primary { background: var(--gold); color: #1a1a1a; }
.btn-primary:hover { background: #f3ab20; color: #000; }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { border-color: var(--teal-light); color: var(--teal-light); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); color: var(--text); }

/* ---------- Sections ---------- */
.section { padding: clamp(40px, 7vw, 80px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head h2::after { content: ""; display: block; width: 48px; height: 3px; background: var(--gold); margin-top: 10px; border-radius: 2px; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.prose { max-width: 50em; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: #0b0f11; }
.card-img.contain { object-fit: contain; padding: 8px; background: #fff; }
.card-body { padding: 18px 20px 20px; flex: 1; }
.card-body p:last-child { margin-bottom: 0; }
.card h3 { margin-bottom: .4em; }
.card a.stretched { text-decoration: none; color: inherit; }
.card a.stretched:hover h3 { color: var(--link-hover); }

.about-figure { margin: 0; }
.about-figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: #000; }
.about-figure figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.news li { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.news time { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.news p { margin: 0; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 2px; } }

/* Notice */
.notice { border-left: 4px solid var(--gold); background: var(--surface); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }

/* ---------- Research ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .92rem; background: var(--surface); }
.toc a:hover { border-color: var(--gold); }
.line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(20px, 4vw, 48px); align-items: start; padding: 32px 0; border-top: 1px solid var(--border); }
.line:nth-of-type(even) .line-img { order: 2; }
.line-img img { border-radius: var(--radius); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b0f11; }
.line.no-img { grid-template-columns: 1fr; }
.line.no-img > div { max-width: 50em; }
@media (max-width: 760px) { .line { grid-template-columns: 1fr; } .line:nth-of-type(even) .line-img { order: 0; } }

/* ---------- Projects ---------- */
.project .card-body { display: flex; flex-direction: column; gap: 6px; }
.project .acronym { font-size: 1.3rem; font-weight: 750; color: var(--text); letter-spacing: .02em; }
.project .ptitle { font-weight: 600; line-height: 1.35; }
.project .meta { font-size: .9rem; color: var(--muted); margin: 0; }
.project .years { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--teal); letter-spacing: .04em; }
.project.has-accent { border-top: 4px solid var(--gold); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-alt); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.stack td { display: block; border: 0; padding: 2px 0; }
  table.stack td.nowrap { color: var(--muted); }
}

/* ---------- People ---------- */
.people { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.person { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.person-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-alt); }
.person-photo.initials { display: grid; place-items: center; font-weight: 700; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, var(--teal), #0a5c5c); letter-spacing: .02em; }
.person h3 { margin: 2px 0 2px; font-size: 1.05rem; }
.person-role { color: var(--teal); font-weight: 600; font-size: .88rem; margin: 0 0 6px; }
@media (prefers-color-scheme: dark) { .person-role { color: var(--teal-light); } }
.person-topics { font-size: .9rem; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.person-links { margin: 0; display: flex; gap: 10px; }
.person-links a { color: var(--muted); }
.person-links a:hover { color: var(--link-hover); }
.group-photo figure { margin: 0; }
.group-photo img { border-radius: var(--radius); }
.group-photo figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.alumni { columns: 3 260px; column-gap: 32px; padding: 0; list-style: none; margin: 0; }
.alumni li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); }
.alumni small { color: var(--muted); }
.people-group { margin-bottom: 48px; }
.people-group > h2 { font-size: 1.4rem; }

/* ---------- Publications ---------- */
.pub-tools { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.pub-tools input { flex: 1 1 260px; font: inherit; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pub-tools input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.pub-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-tabs a { text-decoration: none; font-size: .9rem; padding: 6px 12px; border-radius: 999px; background: var(--bg-alt); color: var(--text); border: 1px solid var(--border); }
.pub-tabs a:hover { border-color: var(--gold); }
.pub-tabs .count { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.pub-section { margin-bottom: 48px; }
.pub-section > h2 { display: flex; align-items: baseline; gap: 10px; }
.pub-section > h2 small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.pub-year { font-size: 1.05rem; color: var(--teal); margin: 28px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .pub-year { color: var(--teal-light); } }
.pubs { margin: 0; padding-left: 0; list-style: none; }
.pubs li { padding: 7px 0 7px 14px; border-left: 2px solid transparent; font-size: .96rem; line-height: 1.55; }
.pubs li:hover { border-left-color: var(--gold); }
.pubs li a { font-weight: 500; }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 4px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.pub-empty { display: none; color: var(--muted); }
.is-filtering .pub-year { display: none; }
.hidden { display: none !important; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .icon { color: var(--teal); margin-top: 4px; flex: none; }
.map { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--bg-alt); }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: #b9c3c6; padding: 48px 0 24px; font-size: .94rem; }
.site-footer a { color: #e6eced; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-logo { width: 84px; margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; columns: 2; }
.footer-links li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 32px; padding-top: 18px; font-size: .85rem; color: #8d999d; }
.footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
