/* andrewnorman.org — site styles
   Replaces neutrino_style.css + footer.css + the dead Bootstrap 3 CDN. */

:root {
  --fnal-blue: #093887;
  --fnal-blue-light: #1a56c4;
  --ink: #1c1f26;
  --ink-muted: #5a616e;
  --rule: #d8dce4;
  --surface: #ffffff;
  --surface-sunk: #f4f6fa;
  --page: #eef2f8;
  --link: #0b4bb5;
  --link-visited: #6b3fa0;
  --max-width: 68rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fnal-blue: #0a2d6b;
    --fnal-blue-light: #4d84e8;
    --ink: #e6e9f0;
    --ink-muted: #a3abbb;
    --rule: #2b3242;
    --surface: #161a22;
    --surface-sunk: #1e232e;
    --page: #0f1218;
    --link: #7aa7f5;
    --link-visited: #b79ae0;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--page);
  background-image: url("eqn_background.png");
  background-size: 800px 600px;
  background-attachment: fixed;
  background-repeat: repeat;
}

/* Keep the equation wallpaper from fighting the text. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--page);
  opacity: 0.88;
  z-index: -1;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:visited {
  color: var(--link-visited);
}

a:hover,
a:focus-visible {
  color: var(--fnal-blue-light);
}

:focus-visible {
  outline: 2px solid var(--fnal-blue-light);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Present to screen readers and search engines, not to the eye. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--fnal-blue);
  padding: 0.75rem 1.25rem;
}

.site-header__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo img {
  display: block;
  height: 46px;
  width: auto;
}

.filmstrip {
  display: flex;
  gap: 0.5rem;
}

.filmstrip img {
  height: 46px;
  width: auto;
  border-radius: 3px;
  object-fit: cover;
}

@media (max-width: 34rem) {
  .filmstrip img:nth-child(n + 3) {
    display: none;
  }
}

/* ---------- Layout ---------- */

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 2rem 1.25rem 3rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 52rem) {
  .intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.bio p {
  margin: 0 0 1rem;
}

.portrait {
  float: left;
  margin: 0.25rem 1.25rem 0.75rem 0;
  max-width: 190px;
  border-radius: var(--radius);
}

@media (max-width: 30rem) {
  .portrait {
    float: none;
    margin: 0 0 1rem;
  }
}

.contact {
  clear: both;
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--fnal-blue-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.contact dl {
  margin: 0.4rem 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.6rem;
}

.contact dt {
  font-weight: 700;
  color: var(--ink-muted);
}

.contact dd {
  margin: 0;
}

/* ---------- Sidebar link groups ---------- */

.sidebar {
  display: grid;
  gap: 1.5rem;
}

.link-group h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--fnal-blue-light);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}

/* Neutrino-bulleted lists, as on the original site. */
.nu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nu-list li {
  background-image: url("nu.png");
  background-size: 10px 10px;
  background-repeat: no-repeat;
  background-position: 0 0.55em;
  padding-left: 1.1rem;
  margin-bottom: 0.35rem;
}

.note {
  color: var(--ink-muted);
  font-size: 0.85em;
}

/* Secondary list under a link group (e.g. superseded PDF downloads). */
.note-list {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dotted var(--rule);
  font-size: 0.9em;
}

/* ---------- Information accordion (was a Bootstrap panel-group) ---------- */

.information {
  margin-top: 3rem;
}

.information > h2 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
}

.accordion {
  display: grid;
  gap: 0.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel > summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--fnal-blue-light);
  background: var(--surface-sunk);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel > summary::-webkit-details-marker {
  display: none;
}

.panel > summary::before {
  content: "▸";
  font-size: 0.8em;
  transition: transform 0.15s ease;
}

.panel[open] > summary::before {
  transform: rotate(90deg);
}

.panel > summary:hover {
  color: var(--link);
}

.panel__body {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--rule);
}

.panel__body > :first-child {
  margin-top: 0;
}

.panel__body > :last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--fnal-blue);
  color: #fff;
  font-size: 0.85rem;
  padding: 1.25rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 44rem) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  display: block;
}

.site-footer__center {
  text-align: center;
}

.site-footer__right {
  text-align: right;
}

@media (max-width: 44rem) {
  .site-footer__right {
    text-align: center;
  }
}

/* ---------- Site nav (header) ---------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: #dce6f8;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
  border-bottom-color: #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: #fff;
}

/* ---------- Git Projects page ---------- */

.site-main > h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  line-height: 1.2;
}

.lede {
  max-width: 60ch;
  color: var(--ink-muted);
  margin: 0 0 1.75rem;
}

.group-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.group-jump a {
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
}

.group-jump a:hover,
.group-jump a:focus-visible {
  border-color: var(--fnal-blue-light);
  background: var(--surface-sunk);
}

.group {
  margin-bottom: 3rem;
  scroll-margin-top: 1rem;
}

.group__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--fnal-blue-light);
}

.group__title a {
  text-decoration: none;
}

.group__title a:hover {
  text-decoration: underline;
}

.group__count {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.group__blurb {
  margin: 0 0 1.25rem;
  max-width: 70ch;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.repo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 0.75rem;
}

.repo {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.repo__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.repo__name {
  font-weight: 700;
  word-break: break-word;
}

.repo__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.repo__meta {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  padding-top: 0.2rem;
}

.repo__lang::before {
  content: "\25CF";
  margin-right: 0.3rem;
  color: var(--fnal-blue-light);
}

/* Badges */

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--private {
  color: #8a5b00;
  background: #fdf0d5;
  border-color: #e8cf9a;
}

.badge--muted {
  color: var(--ink-muted);
  background: var(--surface-sunk);
  border-color: var(--rule);
}

@media (prefers-color-scheme: dark) {
  .badge--private {
    color: #f0c674;
    background: #3a2e14;
    border-color: #5c4a1f;
  }
}

.request-access {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--fnal-blue-light);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.request-access:hover,
.request-access:focus-visible {
  background: var(--fnal-blue-light);
  color: #fff;
}

/* ---------- CV / Resume document pages ---------- */

.doc {
  max-width: 56rem;
}

.doc__header {
  border-bottom: 3px solid var(--fnal-blue-light);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.doc__header h1 {
  margin: 0;
  font-size: 2.15rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.doc__titleline {
  margin: 0.2rem 0 1rem;
  font-size: 1.05rem;
  color: var(--fnal-blue-light);
  font-weight: 700;
}

.doc__contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}

.doc__contact dt {
  color: var(--ink-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding-top: 0.15em;
}

.doc__contact dd {
  margin: 0;
}

.doc__actions {
  margin: 1.25rem 0 0;
}

.doc__switch {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Table of contents */

.doc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.doc-toc a {
  font-size: 0.8rem;
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
}

.doc-toc a:hover,
.doc-toc a:focus-visible {
  border-color: var(--fnal-blue-light);
  background: var(--surface-sunk);
}

.doc-section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 1rem;
}

.doc-section > h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--fnal-blue-light);
}

.doc-section p {
  margin: 0 0 1rem;
  max-width: 72ch;
}

.doc-note {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.entry-group {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  color: var(--fnal-blue-light);
  letter-spacing: 0.01em;
}

.entry-group:first-of-type {
  margin-top: 0;
}

.entry-group__when {
  float: right;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* Entry rows: what | where | when, collapsing to stacked on narrow screens */

.entries {
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 8rem;
  gap: 0.1rem 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.entry:last-child {
  border-bottom: none;
}

.entries--two .entry {
  grid-template-columns: minmax(0, 1fr) 8rem;
}

.entry__what {
  font-weight: 700;
  margin: 0;
}

.entry__where {
  margin: 0;
  color: var(--ink-muted);
}

.entry__when {
  margin: 0;
  text-align: right;
  font-size: 0.85rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.entries--two .entry__when,
.entry:not(:has(.entry__where)) .entry__when {
  grid-column: -2;
}

.entry__note,
.entry__desc {
  grid-column: 1 / -1;
  margin: 0.3rem 0 0.15rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.entry__desc {
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule);
}

@media (max-width: 44rem) {
  .entry,
  .entries--two .entry {
    grid-template-columns: 1fr;
  }

  .entry__when {
    text-align: left;
  }
}

.activity {
  margin-bottom: 2rem;
}

.bullets {
  margin: 0;
  padding-left: 1.2rem;
  max-width: 72ch;
}

.bullets li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.math {
  white-space: nowrap;
}

/* Publications */

.pubs {
  margin: 0;
  padding-left: 1.6rem;
  font-size: 0.92rem;
}

.pubs li {
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.pub__authors {
  color: var(--ink-muted);
}

.pub__venue {
  font-style: italic;
}

.pub__eprint {
  font-size: 0.85em;
  white-space: nowrap;
}

/* ---------- Talks page ---------- */

.talk-year > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.talk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.talk {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--fnal-blue-light);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.talk__title {
  margin: 0 0 0.4rem;
  font-weight: 700;
  line-height: 1.4;
}

.talk__meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.talk__venue {
  font-weight: 700;
  color: var(--ink-muted);
}

.talk__where {
  color: var(--ink-muted);
}

.talk__where::before {
  content: "\00B7";
  margin-right: 0.5rem;
}

.badge--invited {
  color: #0b4f2c;
  background: #dcf3e5;
  border-color: #a8d8bd;
}

.badge--seminar {
  color: #4a3282;
  background: #ece6f8;
  border-color: #c7b8e8;
}

.badge--collab {
  color: var(--fnal-blue-light);
  background: var(--surface-sunk);
  border-color: var(--rule);
}

@media (prefers-color-scheme: dark) {
  .badge--invited {
    color: #7fd4a0;
    background: #14301f;
    border-color: #245c3a;
  }

  .badge--seminar {
    color: #c0a8f0;
    background: #241b3a;
    border-color: #3f3163;
  }
}

/* Abbreviation key rows read better without a date column. */
.entries--key {
  grid-template-columns: 7rem minmax(0, 1fr);
}

/* ---------- Publications page ---------- */

.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.profile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--fnal-blue-light);
  border-radius: var(--radius);
  text-decoration: none;
  min-width: 13rem;
}

.profile:hover,
.profile:focus-visible {
  border-color: var(--fnal-blue-light);
  background: var(--surface-sunk);
}

.profile__name {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.profile__id {
  font-size: 0.95rem;
  font-weight: 700;
}

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pub-search {
  flex: 1 1 22rem;
}

.pub-search input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.8rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.pub-search input:focus-visible {
  outline: 2px solid var(--fnal-blue-light);
  outline-offset: 1px;
}

.pub-controls .doc-note {
  margin: 0;
  white-space: nowrap;
}

.pub-year > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.pub {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  scroll-margin-top: 1rem;
}

.pub__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.pub__title a {
  text-decoration: none;
}

.pub__title a:hover,
.pub__title a:focus-visible {
  text-decoration: underline;
}

.pub__meta {
  margin: 0 0 0.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.pub__source {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.pub__year {
  font-variant-numeric: tabular-nums;
}

.pub__link {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  white-space: nowrap;
}

.pub__link:hover,
.pub__link:focus-visible {
  border-color: var(--fnal-blue-light);
  background: var(--surface-sunk);
}

.pub__report {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

@media print {
  .site-header,
  .site-footer {
    background: none;
    color: #000;
  }

  body {
    background: none;
    color: #000;
  }

  body::before {
    display: none;
  }
}
