/* ============================================================
   AMERICAN BIOS PROJECT
   PALETTE — red / white / blue. Swap these values to re-skin.
   Every color on the site resolves through one of these.
   ============================================================ */
:root {
  --paper:      #FBF9F5; /* page ground — warm white                          */
  --paper-warm: #F4F0E7; /* secondary ground, note blocks, portrait mats      */
  --blue:       #2C4A7C; /* primary blue — headings + section fills (8.4:1)   */
  --blue-deep:  #1E3560; /* darker blue — footer fill, hover states           */
  --blue-mid:   #55627E; /* secondary text on paper (5.6:1)                   */
  --frame:      #4A6CA0; /* border frame and hairline rules                   */
  --rule:       #CFD6E2; /* light hairlines inside blue-adjacent areas        */
  --red:        #A22B33; /* subject names, accent rules, small labels (6.9:1) */
  --on-fill:    #F7F4EC; /* text reversed out of blue fills                   */
  --on-fill-dim:#C3CCDD; /* secondary text on blue fills                      */

  /* Type */
  --display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --serif:   "Source Serif 4", Georgia, "Times New Roman", Times, serif;

  /* Measure and rhythm */
  --measure: 66ch;
  --gutter:  clamp(1.125rem, 4vw, 3.5rem);
  --max:     1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, dl, dd, dt, ul, li, figure, figcaption { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- Base ---------- */
body {
  background: var(--paper-warm);
  color: var(--blue);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding: clamp(0.5rem, 1.5vw, 1.25rem);
}

/* Double-rule frame around the whole page */
.page {
  border: 1px solid var(--frame);
  background: var(--paper);
}
.page__inner {
  border: 1px solid var(--frame);
  margin: 5px;
  overflow: hidden;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms linear, border-color 120ms linear;
}
a:hover { color: var(--red); border-bottom-color: var(--red); }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Small letterspaced serif caps — the site's label voice */
.label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
}

/* Ornamental rule under centered headings */
.ornament {
  width: 64px;
  height: 0;
  border-top: 2px solid var(--red);
  margin: 1.25rem auto 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.masthead {
  padding-block: clamp(1.75rem, 4vw, 3rem) 0;
  text-align: center;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 0.95rem + 2.4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}
.wordmark a:hover { color: var(--red); border-bottom-color: transparent; }
.tagline {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-top: 0.85rem;
}

.nav {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--frame);
  border-bottom: 2px solid var(--red);
}
.nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(0.5rem, 2vw, 1.5rem);
}
.nav a {
  display: block;
  font-family: var(--display);
  font-size: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 1.3rem clamp(0.85rem, 2.5vw, 1.75rem);
  border-bottom: none;
}
.nav a:hover {
  color: var(--red);
  background: var(--paper-warm);
  border-bottom-color: transparent;
}
.nav a[aria-current="page"] { color: var(--red); }
.nav a:focus-visible { outline-offset: -3px; }

/* ============================================================
   HOME — opening statement
   ============================================================ */
.statement {
  min-height: 58svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}
.statement h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.375rem, 0.9rem + 2.2vw, 2.625rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  max-width: 24ch;
  margin-inline: auto;
}
.statement__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3.5vw, 3rem);
  max-width: 56rem;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  text-align: left;
}
.statement__body p { color: var(--blue-mid); }

/* ============================================================
   INTERIOR PAGE HEADS
   ============================================================ */
.page-head {
  text-align: center;
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2.25rem);
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.05rem + 2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 1.25rem;
}
.page-head__sub {
  font-size: 0.9375rem;
  color: var(--blue-mid);
  margin-top: 1.25rem;
}

.prose-section { padding-block: 0 clamp(3rem, 7vw, 5rem); }
.prose {
  max-width: var(--measure);
  margin-inline: auto;
}
.prose p + p { margin-top: 1.3em; }

/* ============================================================
   INDEX OF ENTRIES — solid blue fill
   ============================================================ */
.index {
  background: var(--blue);
  color: var(--on-fill);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}
.section-head { text-align: center; padding-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.875rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-fill);
}
.section-head .ornament { border-top-color: var(--on-fill-dim); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.card {
  background: var(--paper);
  color: var(--blue);
  border: 1px solid var(--frame);
  padding: clamp(1rem, 2vw, 1.375rem);
  text-align: center;
  display: flex;
  flex-direction: column;
}
.portrait {
  border: 1px solid var(--blue);
  background: var(--paper-warm);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  margin-bottom: 1rem;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  color: var(--blue-mid);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.card__rank {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-bottom: 0.4rem;
}
.card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--red);
  margin-bottom: 0.6rem;
}
.card h3 a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.card__dates {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--blue-mid);
  margin-bottom: 0.75rem;
}
.card__excerpt {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--blue-mid);
  flex-grow: 1;
}
.card__meta {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-mid);
}

.more {
  text-align: center;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.more a {
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-fill);
  border-bottom-color: var(--on-fill-dim);
  padding-bottom: 3px;
}
.more a:hover { color: var(--on-fill); border-bottom-color: var(--on-fill); }

/* ============================================================
   BIO ENTRY PAGES
   ============================================================ */
.entry { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }

.backlink {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.entry__header { text-align: center; margin-bottom: clamp(2rem, 4vw, 3rem); }
.entry__header .label { margin-bottom: 1.25rem; }
.entry h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.05rem + 2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: var(--red);
}
.entry__standfirst {
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.1875rem);
  color: var(--blue-mid);
  max-width: 52ch;
  margin: 1.5rem auto 0;
}

.entry__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}
.entry__portrait { margin: 0; }
.entry__portrait .portrait { margin-bottom: 0.75rem; }
.entry__portrait figcaption {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-mid);
  text-align: center;
  line-height: 1.6;
}

.meta {
  border-top: 2px solid var(--red);
  border-bottom: 1px solid var(--frame);
  padding-block: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2.5rem;
}
.meta div { display: flex; flex-direction: column; gap: 0.3rem; }
.meta dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-mid);
}
.meta dd { font-size: 0.9375rem; color: var(--blue); }

.entry__body { max-width: var(--measure); }
.entry__body p + p { margin-top: 1.3em; }

.record-note {
  max-width: var(--measure);
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--blue-mid);
}

/* Researcher's note — the project's own convention, given its own block */
.note {
  max-width: var(--measure);
  margin-top: clamp(2rem, 4vw, 3rem);
  background: var(--paper-warm);
  border: 1px solid var(--frame);
  border-left: 3px solid var(--red);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.prose-section .note { margin-inline: auto; }
.note h2 {
  font-family: var(--display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
}
.note p { font-size: 0.9375rem; line-height: 1.65; color: var(--blue-mid); }
.note p + p { margin-top: 1.1em; }

/* ============================================================
   BOARD
   ============================================================ */
.board {
  max-width: var(--measure);
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  border-top: 2px solid var(--red);
  border-bottom: 1px solid var(--frame);
}
.board li {
  padding-block: 1.5rem;
  text-align: center;
}
.board li + li { border-top: 1px solid var(--rule); }
.board__name {
  font-family: var(--display);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  letter-spacing: 0.04em;
  color: var(--red);
}
.board__role {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-mid);
  margin-top: 0.5rem;
}
.board__email {
  font-size: 0.9375rem;
  margin-top: 0.65rem;
}
.board__email a {
  color: var(--blue);
  border-bottom-color: var(--rule);
}

/* ============================================================
   FOOTER — solid deep blue fill
   ============================================================ */
.footer {
  background: var(--blue-deep);
  color: var(--on-fill-dim);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.875rem;
  line-height: 1.8;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.footer__grid h2 {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-fill);
  margin-bottom: 0.85rem;
}
.footer a { border-bottom-color: rgba(247, 244, 236, 0.35); }
.footer a:hover { color: var(--on-fill); border-bottom-color: var(--on-fill); }
.footer__colophon {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(247, 244, 236, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE — collapse columns rather than scaling type down
   ============================================================ */
@media (max-width: 900px) {
  .cards         { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry__layout { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .nav ul          { flex-direction: column; gap: 0; }
  .nav li + li     { border-top: 1px solid var(--rule); }
  .nav a           { padding-block: 0.7rem; }
  .statement       { min-height: 54svh; }
  .statement__body { grid-template-columns: minmax(0, 1fr); }
  .cards           { grid-template-columns: minmax(0, 1fr); }
  .entry__layout   { grid-template-columns: minmax(0, 1fr); }
  .entry__portrait { max-width: 260px; margin-inline: auto; }
  .meta            { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .footer__grid    { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
