/* ============================================================
   Hall Research Group — "Paper White"
   Layout follows the old mattdhall.com: split hero with a figure,
   full-bleed dark bands, a three-up research row, themed research
   sections with their papers alongside, portraits on a two-up grid,
   and publications as flowing citations.
   Newsreader for headlines, Archivo for body, IBM Plex Mono for anything
   a scientist would read as data.
   ============================================================ */

:root {
  /* colour — "Paper White": cool near-white, graphite, deep vermilion */
  --paper:      #F8F9FA;
  --paper-deep: #EDF0F2;
  --ink:        #15181B;
  --ink-soft:   #454B51;
  --ink-faint:  #7C838A;
  --accent:     #A62D1F;
  --accent-lift:#D2503C;
  --rule:       #DCE1E5;
  --rule-soft:  #E9EDEF;
  /* on dark bands */
  --band-bg:    #15181B;
  --band-fg:    #F2F4F5;
  --band-soft:  #9AA1A8;
  --band-rule:  #2A2F34;

  /* type */
  --display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --text: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rail: 5.5rem;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #F3D4CE; }

/* ---------- shell + bands ---------- */

.shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* a full-bleed dark band; .shell goes inside it */
.band {
  background: var(--band-bg);
  color: var(--band-fg);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.band a { color: var(--band-fg); }
.band a:hover { color: var(--accent-lift); }
.band .label { color: var(--band-soft); }
.band p { color: var(--band-soft); }
.band h2, .band h3 { color: var(--band-fg); }
.band-tight { padding-block: clamp(1.75rem, 4vw, 2.5rem); }

/* a quiet band: same structure, page colours. For sections that are
   context rather than a call to action. */
.band-pale {
  --band-bg: var(--paper-deep);
  --band-fg: var(--ink);
  --band-soft: var(--ink-soft);
  --band-rule: var(--rule);
  border-block: 1px solid var(--rule);
}
.band-pale a:hover { color: var(--accent); }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--ink);
  padding-block: 1.3rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--accent); }
.wordmark .mark { width: 1.6rem; height: 1.6rem; mix-blend-mode: multiply; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.3rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: 0;
}
.nav a { text-decoration: none; color: var(--ink-soft); padding-block: .15rem; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--accent); }

.nav .btn {
  background: var(--accent);
  color: var(--paper);
  padding: .4rem .85rem;
  box-shadow: none;
}
.nav .btn:hover { background: var(--ink); color: var(--paper); }

.nav .icon { display: inline-flex; color: var(--ink-soft); }
.nav .icon svg { width: 1rem; height: 1rem; fill: currentColor; display: block; }
.nav .icon:hover { color: var(--accent); }

/* ---------- shared pieces ---------- */

.label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.measure { max-width: var(--measure); }

.display {
  font-family: var(--display);
  font-optical-sizing: auto;   /* Newsreader is variable: let the browser pick the optical size */
  font-weight: 400;
  letter-spacing: -.016em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
}
h1.display { font-size: clamp(2.35rem, 5.5vw, 4rem); }
h2.display { font-size: clamp(1.85rem, 3.9vw, 2.65rem); line-height: 1.06; }
h3.display { font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.18; font-weight: 500; letter-spacing: -.009em; }

.lede { font-size: 1.05rem; line-height: 1.6; color: var(--ink-soft); }

.section {
  padding-block: clamp(2.5rem, 5.5vw, 4rem);
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}
.section-head .label { padding-top: .5rem; }
@media (max-width: 46rem) {
  .section-head { grid-template-columns: 1fr; gap: .6rem; }
  .section-head .label { padding-top: 0; }
}

/* ---------- split hero (text | figure) ---------- */

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.hero-split h1 { margin: 0 0 1.5rem; max-width: 16ch; }
.hero-split .lede { max-width: 34rem; }
@media (max-width: 54rem) {
  .hero-split { grid-template-columns: 1fr; }
}

/* ---------- image slots ---------- */

figure { margin: 0; }

.figure-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--rule);
  background: var(--paper-deep);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1.25rem;
  gap: .4rem;
}
.figure-slot .slot-name {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  word-break: break-all;
}
.figure-slot .slot-note {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--ink-faint);
  line-height: 1.5;
}
.figure-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.figure-slot.portrait img { object-position: center 28%; }

.plate { margin: 0; }
.plate img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

figcaption {
  margin-top: .6rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- three-up research row ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.card .figure-slot { aspect-ratio: 3 / 2; }
.card .card-img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }
.card h3 { margin: 1.1rem 0 .5rem; }
.card p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; }
.card .num {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  color: var(--accent);
  display: block;
  margin-top: 1rem;
}

.more {
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  font-family: var(--mono);
  font-size: .74rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: .18rem;
  transition: color .18s ease, border-color .18s ease;
}
.more::after { content: "\2192"; transition: transform .18s ease; }
.more:hover { color: var(--accent); border-color: var(--accent); }
.more:hover::after { transform: translateX(3px); }

.more-inline, p > .more { vertical-align: baseline; margin-left: .35rem; }

.band .more { color: var(--band-fg); border-color: var(--band-soft); }
.band .more:hover { color: var(--accent-lift); border-color: var(--accent-lift); }

/* ---------- themed research section: prose | its papers ---------- */

/* page opener: the three themes as a numbered index */
.hero-index {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: clamp(2.25rem, 5.5vw, 4rem) clamp(1.5rem, 3.5vw, 2.5rem);
}
.hero-index-head .label { margin-bottom: 1.1rem; }

.theme-index { list-style: none; margin: 0; padding: 0; }
.theme-index li { border-top: 1px solid var(--rule); }
.theme-index li:last-child { border-bottom: 1px solid var(--rule); }
.theme-index a {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: .5rem;
  align-items: baseline;
  padding-block: .85rem;
  text-decoration: none;
  transition: color .18s ease;
}
.theme-index .n { font-family: var(--mono); font-size: .76rem; color: var(--accent); }
.theme-index .t { font-family: var(--display); font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.2; }
.theme-index a:hover .t { color: var(--accent); }

@media (max-width: 52rem) {
  .hero-index { grid-template-columns: 1fr; }
}

.theme { padding-block: clamp(2.25rem, 5vw, 3.5rem); border-top: 1px solid var(--rule); }
.theme > h1, .theme > h2 { margin: 0 0 .75rem; max-width: none; }
.theme > .theme-q { margin: 0 0 2rem; font-family: var(--mono); font-size: .82rem; color: var(--accent); }

.theme-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 52rem) { .theme-grid { grid-template-columns: 1fr; } }

.theme-grid .prose p { margin: 0 0 1rem; color: var(--ink-soft); max-width: 36rem; }
.theme-grid .prose p:last-child { margin-bottom: 0; }

.theme-papers { border-top: 1px solid var(--rule); padding-top: 1rem; }
.theme-papers .label { margin-bottom: .9rem; }

/* ---------- citations ---------- */

.cite-list { list-style: none; margin: 0; padding: 0; }

.cite {
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  padding-block: .7rem;
  border-top: 1px solid var(--rule-soft);
  max-width: 48rem;
  font-variant-numeric: tabular-nums;
}
.cite:first-child { border-top: 0; }
.theme-papers .cite:first-child { border-top: 0; }
.cite b { color: var(--ink); font-weight: 600; }
.cite i, .cite cite { font-style: italic; }
.cite .ttl { color: var(--ink); }
.cite a {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.cite a:hover { color: var(--accent); border-color: var(--accent); }
.cite a.pdf { color: var(--accent); border-color: var(--accent); }

/* publications page */

.pub-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-block: .9rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}
.filter-field { display: flex; align-items: baseline; gap: .6rem; flex: 1 1 16rem; min-width: 0; }
.filter-field label { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
.filter-field input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: .85rem;
  background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  padding: .3rem 0; color: var(--ink);
}
.filter-field input:focus { outline: 0; border-bottom-color: var(--accent); }
.filter-field input::placeholder { color: var(--ink-faint); }
.count { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

.year-strip {
  display: flex; flex-wrap: wrap; gap: .2rem .9rem;
  padding-block: .8rem; border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: .74rem;
}
.year-strip a { text-decoration: none; color: var(--ink-faint); }
.year-strip a:hover { color: var(--accent); }

.year-group { padding-block: 1.5rem 0; }
.year-group > h2 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .08em;
  margin: 0 0 .25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
  scroll-margin-top: 5rem;
}

.empty-note { padding-block: 3rem; color: var(--ink-faint); font-family: var(--mono); font-size: .85rem; }

/* ---------- people ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
  list-style: none; margin: 0; padding: 0;
}
.person .figure-slot { max-width: 18rem; }
.person h3 { margin: 1rem 0 .3rem; }
.person .role {
  margin: 0 0 .8rem;
  font-family: var(--mono); font-size: .76rem;
  color: var(--accent);
}
.person .bio { margin: 0; color: var(--ink-soft); font-size: .95rem; max-width: 30rem; }
.person .links { margin: .8rem 0 0; display: flex; flex-wrap: wrap; gap: .9rem; }
.person .links a {
  font-family: var(--mono); font-size: .7rem;
  text-decoration: none; color: var(--ink-faint);
  border-bottom: 1px solid var(--rule); padding-bottom: .12rem;
}
.person .links a:hover { color: var(--accent); border-color: var(--accent); }

.alumni { font-family: var(--mono); font-size: .82rem; line-height: 2; color: var(--ink-soft); max-width: 44rem; margin: 0; }

/* ---------- news ---------- */

.news-list { list-style: none; margin: 0; padding: 0; }
.news-item {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: clamp(1.4rem, 3vw, 2rem);
  border-top: 1px solid var(--rule);
}
.news-item:last-child { border-bottom: 1px solid var(--rule); }
.news-date {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--ink-faint); padding-top: .4rem; line-height: 1.5;
}
.news-item h3 { margin: 0 0 .5rem; max-width: 26ch; }
.news-item p { margin: 0 0 .7rem; max-width: var(--measure); color: var(--ink-soft); }
.news-item p:last-child { margin-bottom: 0; }
@media (max-width: 46rem) {
  .news-item { grid-template-columns: 1fr; gap: .4rem; }
  .news-date { padding-top: 0; }
}

/* ---------- prose / contact ---------- */

.prose p { max-width: var(--measure); color: var(--ink-soft); }
.prose p:first-child { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: clamp(1.75rem, 4vw, 3rem); }
.contact-grid h3 { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin: 0 0 .7rem; }
.contact-grid p { margin: 0 0 .4rem; color: var(--ink-soft); line-height: 1.7; font-family: var(--mono); font-size: .85rem; }
.contact-grid a { color: var(--ink); }

.centred { text-align: center; }
.centred .measure, .centred p { margin-inline: auto; }

/* ---------- contact form ---------- */

.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 44rem;
}
.form .field-wide { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.field input,
.field textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: .5rem 0;
  border-radius: 0;
  width: 100%;
  min-width: 0;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus,
.field textarea:focus { outline: 0; border-bottom-color: var(--accent); }
.field input:user-invalid,
.field textarea:user-invalid { border-bottom-color: var(--accent); }

.form button {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--paper);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: .7rem 1.5rem;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.form button:hover { background: var(--ink); border-color: var(--ink); }

/* honeypot: present for bots, gone for people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--ink);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-block: 1.75rem 2.75rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem;
  justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: .74rem; color: var(--ink-faint);
}
.footer a { text-decoration: none; color: var(--ink-soft); }
.footer a:hover { color: var(--accent); }
.footer .footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }

/* ---------- utility ---------- */

.stack > * + * { margin-top: 1.5rem; }
.mt-lg { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.mt-sm { margin-top: clamp(.9rem, 2vw, 1.2rem); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 50; text-decoration: none; }
.skip:focus { left: .5rem; top: .5rem; }
