/* ==========================================================================
   Dooher Institute of Physics and Energy
   main.css — single stylesheet, no external dependencies, no web fonts.
   Organisation:
     1. Tokens          5. Typography      9. Publications
     2. Reset           6. Layout         10. Timeline
     3. Accessibility   7. Components     11. Footer
     4. Header / nav    8. Tables         12. Responsive & motion
   ========================================================================== */

/* 1. TOKENS ------------------------------------------------------------- */
:root {
  --ink:        #12161c;   /* primary text: deep charcoal-navy */
  --ink-2:      #333c48;   /* secondary text */
  --muted:      #5f6a79;   /* metadata, captions */
  --faint:      #8b95a3;   /* least important text */
  --accent:     #10476b;   /* single restrained scientific accent */
  --accent-dk:  #0a3350;
  --accent-bg:  #eef3f7;
  --bg:         #fdfdfc;   /* off-white page */
  --panel:      #f5f6f7;   /* subtle panel fill */
  --panel-2:    #eceef0;
  --rule:       #dcdfe4;   /* hairline rules */
  --rule-2:     #c3c9d1;
  --warn-bg:    #fbf7ec;
  --warn-rule:  #d8c9a3;

  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap:  1120px;
  --prose: 74ch;
  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;   --sp-7: 3rem;   --sp-8: 4.5rem;
}

/* 2. RESET -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-sans);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.35em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--sp-6) 0; }

/* 3. ACCESSIBILITY ------------------------------------------------------ */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: .5rem; top: .5rem; }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 4. HEADER / NAV ------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--accent); }
.brand__mark { flex: none; width: 38px; height: 38px; color: var(--accent); }
.brand__text { display: block; }
.brand__name {
  display: block; font-family: var(--font-serif);
  font-size: 1.06rem; font-weight: 700; letter-spacing: .01em; line-height: 1.15;
}
.brand__sub {
  display: block; font-size: .72rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-top: .18rem;
}

.nav { font-size: .93rem; }
.nav__toggle {
  display: none; cursor: pointer;
  padding: .45rem .8rem; border: 1px solid var(--rule-2); border-radius: 3px;
  font-weight: 600; color: var(--ink-2); background: var(--panel);
}
.nav__toggle::after { content: " \25BE"; color: var(--muted); }
.nav__toggle[aria-expanded="true"]::after { content: " \25B4"; }
.nav__list {
  list-style: none; margin: var(--sp-3) 0 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.nav__list a {
  display: block; padding: .5rem .2rem; text-decoration: none;
  color: var(--ink-2); border-bottom: 1px solid var(--rule);
}
.nav__list a:hover { color: var(--accent); }
.nav__list a[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* 5. TYPOGRAPHY --------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.7rem); line-height: 1.15; margin: 0 0 var(--sp-4); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); line-height: 1.25; margin: var(--sp-7) 0 var(--sp-3); }
h3 { font-size: 1.15rem; line-height: 1.3; margin: var(--sp-6) 0 var(--sp-2); }
h2 + h3 { margin-top: var(--sp-4); }
p { margin: 0 0 var(--sp-4); }
a { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dk); text-decoration-thickness: 2px; }
strong { font-weight: 650; }
small, .small { font-size: .875rem; }
.lede { font-size: 1.16rem; line-height: 1.6; color: var(--ink-2); }
.eyebrow {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 0 0 var(--sp-3);
}
blockquote {
  margin: var(--sp-5) 0; padding: 0 0 0 var(--sp-4);
  border-left: 3px solid var(--rule-2);
  font-family: var(--font-serif); font-size: 1.06rem; color: var(--ink-2);
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite { display: block; margin-top: var(--sp-3); font: 400 .85rem/1.5 var(--font-sans); color: var(--muted); font-style: normal; }
code, kbd { font-family: var(--font-mono); font-size: .9em; background: var(--panel); padding: .1em .35em; border-radius: 2px; }

/* 6. LAYOUT ------------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-5); }
.prose { max-width: var(--prose); }
main { display: block; padding-bottom: var(--sp-8); }
.page-head {
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-7) 0 var(--sp-6);
  margin-bottom: var(--sp-6);
}
.section { margin-top: var(--sp-7); }
.section--panel {
  background: var(--panel); border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-7) 0; margin-top: var(--sp-8);
}
.cols-2 { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
.cols-3 { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
.split { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }

/* breadcrumbs */
.crumbs { font-size: .82rem; color: var(--muted); padding: var(--sp-4) 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs li::after { content: "/"; margin-left: .4rem; color: var(--faint); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }

/* 7. COMPONENTS --------------------------------------------------------- */
.hero { border-bottom: 1px solid var(--rule); padding: var(--sp-8) 0 var(--sp-7); position: relative; overflow: hidden; }
.hero__inner { position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--sp-5); }
.hero__art { position: absolute; inset: 0; z-index: 1; opacity: .5; pointer-events: none; }
.hero__art svg { width: 100%; height: 100%; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.35rem); margin-bottom: var(--sp-4); }
.hero__sub { font-size: clamp(1.05rem, .98rem + .45vw, 1.28rem); color: var(--ink-2); max-width: 60ch; margin-bottom: var(--sp-5); }
.hero__status {
  display: inline-block; font-size: .84rem; color: var(--ink-2);
  background: var(--accent-bg); border: 1px solid #d3e0ea;
  padding: .4rem .8rem; border-radius: 3px;
}

.card {
  border: 1px solid var(--rule); background: #fff;
  padding: var(--sp-5); border-radius: 3px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card__meta { font-size: .8rem; color: var(--muted); margin: 0 0 var(--sp-2); letter-spacing: .04em; text-transform: uppercase; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--rule-2); box-shadow: 0 1px 3px rgba(18,22,28,.07); }
a.card h3 { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0; }
.btn {
  display: inline-block; padding: .6rem 1.05rem;
  border: 1px solid var(--accent); border-radius: 3px;
  color: var(--accent); background: #fff;
  font-size: .9rem; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--accent); color: #fff; }
.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }
.btn--ext::after { content: " \2197"; font-weight: 400; }

.badge {
  display: inline-block; font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 2px;
  background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--rule);
  white-space: nowrap;
}
.badge--journal   { background: #e9f0f6; border-color: #cfdde8; color: #123f5e; }
.badge--conf      { background: #eef0ec; border-color: #d7dcd2; color: #3d4a35; }
.badge--report    { background: #f3eee8; border-color: #ddd3c5; color: #5a4a33; }
.badge--gov       { background: #f0ece8; border-color: #d9cec2; color: #543f2c; }
.badge--patent    { background: #efecf3; border-color: #d5cee0; color: #453a58; }

.note {
  border-left: 3px solid var(--rule-2); background: var(--panel);
  padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) 0; font-size: .93rem;
}
.note--source { border-left-color: var(--accent); background: var(--accent-bg); }
.note--caveat { border-left-color: var(--warn-rule); background: var(--warn-bg); }
.note p:last-child { margin-bottom: 0; }
.note .note-title, .card .note-title {
  font: 650 1rem/1.4 var(--font-sans); letter-spacing: .01em;
  margin: 0 0 var(--sp-2); color: var(--ink);
}

.sources { font-size: .9rem; }
.sources ol { padding-left: 1.4em; }
.sources li { margin-bottom: var(--sp-3); }
.sources .src-type { color: var(--muted); }

.figure { margin: var(--sp-6) 0; }
.figure svg { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: #fff; }
.figure figcaption { font-size: .82rem; color: var(--muted); margin-top: var(--sp-2); }

.monogram {
  width: 128px; height: 128px; flex: none;
  border: 1px solid var(--rule); background: #fff; color: var(--accent);
}

.profile-head { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; align-items: start; }
.kv { margin: 0; font-size: .95rem; }
.kv > div { display: grid; grid-template-columns: 1fr; gap: .1rem; padding: var(--sp-3) 0; border-bottom: 1px solid var(--rule); }
.kv dt { color: var(--muted); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.kv dd { margin: 0; }

/* 8. TABLES ------------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: var(--sp-5) 0; border: 1px solid var(--rule); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; background: #fff; }
caption { text-align: left; font-size: .85rem; color: var(--muted); padding: var(--sp-3); border-bottom: 1px solid var(--rule); }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--panel); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 9. PUBLICATIONS ------------------------------------------------------- */
.filters {
  border: 1px solid var(--rule); background: var(--panel);
  padding: var(--sp-4); margin: var(--sp-5) 0;
  display: grid; gap: var(--sp-4); grid-template-columns: 1fr;
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field input, .field select {
  font: inherit; font-size: .95rem; padding: .5rem .6rem;
  border: 1px solid var(--rule-2); border-radius: 3px; background: #fff; color: var(--ink);
}
.filters__status { font-size: .88rem; color: var(--muted); }

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  padding: var(--sp-5) 0; border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr; gap: var(--sp-2);
}
.pub__year { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .9rem; }
.pub__title { font-family: var(--font-serif); font-size: 1.06rem; font-weight: 700; margin: 0; line-height: 1.35; }
.pub__authors { font-size: .93rem; color: var(--ink-2); margin: 0; }
.pub__venue { font-size: .93rem; color: var(--muted); margin: 0; }
.pub__venue em { color: var(--ink-2); }
.pub__links { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; font-size: .85rem; margin-top: .2rem; }
.pub__note { font-size: .85rem; color: var(--muted); margin: 0; }
.doi { font-family: var(--font-mono); font-size: .82rem; word-break: break-all; }
.cite-btn {
  font: inherit; font-size: .82rem; cursor: pointer;
  background: #fff; border: 1px solid var(--rule-2); border-radius: 3px;
  padding: .25rem .6rem; color: var(--ink-2);
}
.cite-btn:hover { border-color: var(--accent); color: var(--accent); }
.cite-box {
  margin-top: var(--sp-3); width: 100%; font-family: var(--font-mono);
  font-size: .78rem; line-height: 1.5; padding: var(--sp-3);
  border: 1px solid var(--rule-2); border-radius: 3px; background: var(--panel);
  color: var(--ink); resize: vertical;
}
.no-results { padding: var(--sp-6) 0; color: var(--muted); }

/* 10. TIMELINE ---------------------------------------------------------- */
.timeline { list-style: none; margin: var(--sp-5) 0; padding: 0; border-left: 2px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 var(--sp-5) var(--sp-5); }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: .5rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.timeline__year {
  display: block; font-weight: 700; font-size: .84rem;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-bottom: .2rem;
}
.timeline p { margin: 0 0 var(--sp-2); }
.timeline .src { font-size: .82rem; color: var(--muted); }

/* 11. FOOTER ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--rule); background: var(--panel);
  padding: var(--sp-7) 0 var(--sp-6); font-size: .9rem; color: var(--ink-2);
}
.site-footer h2 { font-family: var(--font-sans); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--sp-3); }
.footer-grid { display: grid; gap: var(--sp-6); grid-template-columns: 1fr; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--accent); }
.footer-legal {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--rule-2); font-size: .84rem; color: var(--muted);
}
.footer-legal p { margin: 0 0 var(--sp-2); }


/* --- Intrinsic-size containment -----------------------------------------
   Grid and flex items default to `min-width: auto`, which lets a wide table,
   image or <select> push a column past the viewport. Every grid child below is
   explicitly allowed to shrink, and long strings are allowed to wrap, so no
   page ever scrolls horizontally at any width. Wide content scrolls inside its
   own container instead. */
.wrap, .prose, main { min-width: 0; }
.split > *, .cols-2 > *, .cols-3 > *, .footer-grid > *, .profile-head > *,
.filters > *, .pub > *, .kv > div, .site-header__inner > *, .btn-row > * { min-width: 0; }
.table-scroll { max-width: 100%; }
.figure img, .hero__art img { width: 100%; height: auto; }
.field, .field input, .field select { max-width: 100%; width: 100%; min-width: 0; }
p, li, dd, dt, blockquote, figcaption, td, th, caption, h1, h2, h3 { overflow-wrap: break-word; }
.doi, .cite-box, .kv dd, a[href^="mailto:"] { overflow-wrap: anywhere; }
/* The two-column definition layout needs room. Inside a card (which sits in a
   narrow sidebar column) it stays single-column at every width. */
.card .kv > div { grid-template-columns: 1fr; gap: .1rem; }

/* 12. RESPONSIVE & MOTION ---------------------------------------------- */
@media (min-width: 560px) {
  .cols-2 { grid-template-columns: repeat(2, 1fr); }
  .kv > div { grid-template-columns: 12rem 1fr; gap: var(--sp-4); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
  .pub { grid-template-columns: 5.5rem 1fr; }
  .pub__year { grid-row: 1 / -1; padding-top: .15rem; }
}
@media (min-width: 760px) {
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .split { grid-template-columns: 1.7fr 1fr; gap: var(--sp-7); }
  .profile-head { grid-template-columns: 128px 1fr; gap: var(--sp-6); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
}
/* Mobile menu is a progressive enhancement: without JavaScript the full
   navigation list is always visible and no toggle button is shown. */
@media (max-width: 899px) {
  .js .nav__toggle { display: block; }
  .js .nav__list[data-collapsed="true"] { display: none; }
}
@media (min-width: 900px) {
  .nav__list { flex-direction: row; margin-top: 0; gap: var(--sp-5); flex-wrap: wrap; }
  .nav__list a { border-bottom: 2px solid transparent; padding: .2rem 0; }
  .nav__list a:hover { border-bottom-color: var(--rule-2); }
  .nav__list a[aria-current="page"] { border-bottom-color: var(--accent); }
  .js .nav__list[data-collapsed="true"] { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --muted: #4a5462; --rule: #b9bfc7; }
}
