/* ---------------------------------------------------------------------------
   Enron email -- a sibling of the Hillards archive interface on
   algorithmicindexing.net, sharing its system.

   Every colour and face is a token in this first block. To match the parent
   site exactly, change these and nothing else.

   Two faces with separate jobs: Archivo for the interface, Courier Prime for
   anything that came out of the archive itself -- message bodies, subjects
   as quoted, the words a search matched. A reader can always tell the
   corpus's words from ours. One accent, stamp red, for matches only.
--------------------------------------------------------------------------- */
/* Self-hosted (SIL OFL), so the page needs nothing from Google. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/archivo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/archivo-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/courier-prime-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/courier-prime-latin-700-normal.woff2") format("woff2"); }

:root {
  --ground:     #e7eaef;
  --paper:      #fbfbf9;
  --ink:        #19212e;
  --ink-soft:   #586374;
  --ink-faint:  #8b94a1;
  --rule:       #c7ced8;
  --bar:        #9aa6b6;
  --stamp:      #a62b1c;
  --stamp-wash: #f4dedb;
  --focus:      #1f5fa8;

  --shell: 72rem;
  --measure: 66ch;

  --fs-micro: .75rem;
  --fs-small: .875rem;
  --fs-body:  1rem;
  --fs-lead:  1.1875rem;
  --fs-h2:    1.375rem;
  --fs-h1:    clamp(1.6rem, 1.1rem + 2.2vw, 2.25rem);
  --fs-hero:  clamp(1.85rem, 1.1rem + 3.2vw, 2.85rem);

  --sans: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --type: "Courier Prime", "Courier New", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #14181f; --paper: #1d222b; --ink: #dfe4ec; --ink-soft: #9aa4b3;
    --ink-faint: #6d7684; --rule: #333c49; --bar: #56627a;
    --stamp: #e08275; --stamp-wash: #3d2420; --focus: #6fa8e8;
  }
}

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

body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 1.5rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--type); }

/* --- Masthead ------------------------------------------------------------ */

.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead-inner {
  max-width: var(--shell); margin: 0 auto; padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.wordmark { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.wordmark a { text-decoration: none; }
.parent { font-size: var(--fs-small); color: var(--ink-soft); }
.masthead .finder { flex: 1 1 18rem; max-width: 34rem; margin-left: auto; }

/* --- Search field -------------------------------------------------------- */

.finder { display: flex; gap: .5rem; }
.finder input {
  flex: 1 1 auto; min-width: 0; font-family: var(--sans); font-size: var(--fs-body);
  padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper); color: var(--ink);
}
.finder input::placeholder { color: var(--ink-faint); }
.finder button {
  font-family: var(--sans); font-size: var(--fs-small); font-weight: 600;
  padding: .6rem 1.1rem; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper); cursor: pointer; white-space: nowrap;
}
.finder button:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.finder-hero input { font-size: var(--fs-lead); padding: .85rem 1rem; }
.finder-hero button { font-size: var(--fs-body); padding: .85rem 1.5rem; }

/* --- Timeline -----------------------------------------------------------
   The memorable element. A fixed span of months, the same on every page, so
   the autumn of 2001 always sits in the same place and every result set can
   be read against the shape of the whole. Each bar is a link to that month. */

.tl { margin: 0; }
/* Event labels stack one to a row above the bars, so events a month or two
   apart never overprint each other; each dashed line runs up to its own label. */
.tl-plot { position: relative; height: calc(var(--tl-h, 7.5rem) + var(--rows, 0) * 1.15rem); padding-top: calc(var(--rows, 0) * 1.15rem + .25rem); }
.tl-bars { display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.tl-bar {
  flex: 1 1 0; min-width: 0; display: block; height: 100%;
  position: relative; text-decoration: none;
}
.tl-bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--h) * 100%); min-height: var(--min, 0);
  background: var(--bar);
}
.tl-bar.has { --min: 1px; }
.tl-bar:hover::after, .tl-bar:focus-visible::after { background: var(--ink); }
.tl-event {
  position: absolute; top: calc(var(--row) * 1.15rem + .55rem); bottom: 0; width: 0;
  border-left: 1px dashed var(--ink-soft); pointer-events: none;
}
.tl-event span {
  position: absolute; top: -.6rem; left: .35rem; white-space: nowrap;
  font-size: var(--fs-micro); color: var(--ink-soft); line-height: 1.2;
}
.tl-event.flip span { left: auto; right: .35rem; }
.tl-axis { position: relative; height: 1.4rem; border-top: 1px solid var(--rule); }
.tl-axis span {
  position: absolute; top: .2rem; font-size: var(--fs-micro); color: var(--ink-faint);
  border-left: 1px solid var(--rule); padding-left: .3rem;
}
.tl-note { font-size: var(--fs-micro); color: var(--ink-faint); margin: .35rem 0 0; }
@media (max-width: 40rem) { .tl-event span { font-size: .6875rem; } }

/* --- Home ---------------------------------------------------------------- */

.hero { padding: 2.75rem 0 1.5rem; }
.hero h1 {
  font-size: var(--fs-hero); font-weight: 600; line-height: 1.08;
  letter-spacing: -.025em; margin: 0 0 1rem; max-width: 30ch;
}
.hero-sub { font-size: var(--fs-lead); color: var(--ink-soft); max-width: var(--measure); margin: 0 0 1.75rem; }
.hero .tl { margin-top: 2.5rem; --tl-h: 9rem; }

.suggestions { margin: 1.1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.suggestions .lede { font-size: var(--fs-small); color: var(--ink-soft); margin-right: .25rem; }
.chip {
  font-family: var(--type); font-size: var(--fs-small); padding: .3rem .65rem;
  border: 1px solid var(--rule); border-radius: 2px; background: var(--paper);
  text-decoration: none; display: inline-flex; align-items: baseline; gap: .55rem;
}
.chip:hover { border-color: var(--ink-soft); }
.chip em {
  font-family: var(--sans); font-style: normal; font-size: var(--fs-micro);
  color: var(--ink-faint); border-left: 1px solid var(--rule); padding-left: .55rem;
}

.scope {
  border-top: 1px solid var(--rule); margin-top: 2.5rem; padding: 2rem 0 1rem;
  display: grid; gap: 2.5rem;
}
@media (min-width: 54rem) { .scope { grid-template-columns: 1.3fr 1fr; } }
.scope h2 { font-size: var(--fs-h2); font-weight: 600; margin: 0 0 .75rem; letter-spacing: -.015em; }
.scope p { margin: 0 0 1rem; max-width: var(--measure); color: var(--ink-soft); }
.scope p strong { color: var(--ink); font-weight: 500; }

.syntax { margin: 0; font-size: var(--fs-small); }
.syntax div {
  display: grid; grid-template-columns: 11rem 1fr; gap: 1rem;
  padding: .45rem 0; border-bottom: 1px solid var(--rule);
}
.syntax div:first-child { border-top: 1px solid var(--rule); }
.syntax dt { font-family: var(--type); }
.syntax dd { margin: 0; color: var(--ink-soft); }

/* --- Results ------------------------------------------------------------- */

.resultbar { padding: 1.75rem 0 .75rem; display: flex; gap: 1rem 1.5rem; align-items: baseline; flex-wrap: wrap; }
.resultbar h1 { font-size: var(--fs-h2); font-weight: 600; margin: 0; letter-spacing: -.015em; }
.resultbar h1 .mono { font-weight: 400; }
.controls { margin-left: auto; font-size: var(--fs-small); color: var(--ink-soft); display: flex; gap: 1.1rem; flex-wrap: wrap; }
.controls [aria-current] { color: var(--ink); font-weight: 600; text-decoration: none; }

.results-tl { margin: .25rem 0 1.5rem; --tl-h: 5.5rem; }

.aside {
  background: var(--paper); border-left: 2px solid var(--stamp);
  padding: .8rem 1.1rem; margin: 0 0 1.5rem; font-size: var(--fs-small); max-width: 52rem;
}
.aside p { margin: 0 0 .4rem; color: var(--ink-soft); }
.aside p:last-child { margin-bottom: 0; }
.asread { font-family: var(--type); color: var(--stamp); }

.layout { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .layout { grid-template-columns: minmax(0, 1fr) 15rem; } }

.results { list-style: none; margin: 0; padding: 0; }
.result {
  display: grid; gap: .25rem 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--rule);
}
@media (min-width: 40rem) { .result { grid-template-columns: 7rem minmax(0, 1fr); } }
.when { font-size: var(--fs-small); color: var(--ink-soft); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.when.undated { color: var(--ink-faint); }
.route { font-size: var(--fs-small); color: var(--ink-soft); margin: 0 0 .2rem; }
.route a { text-decoration: none; color: var(--ink); }
.route a:hover { text-decoration: underline; }
.result h2 { font-size: var(--fs-body); font-weight: 600; margin: 0 0 .35rem; letter-spacing: -.005em; }
.result h2 a { text-decoration: none; }
.result h2 a:hover { text-decoration: underline; }
.snippet { font-family: var(--type); font-size: var(--fs-small); line-height: 1.6; margin: 0; max-width: var(--measure); color: var(--ink-soft); }
mark { background: var(--stamp-wash); color: var(--stamp); font-weight: 700; padding: 0 .12em; }
.provenance { margin: .45rem 0 0; font-size: var(--fs-small); color: var(--ink-faint); }

.facets h2 { font-size: var(--fs-small); font-weight: 600; margin: 0 0 .5rem; }
.facets ol { list-style: none; margin: 0 0 2rem; padding: 0; font-size: var(--fs-small); }
.facets li { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--rule); }
.facets li:first-child { border-top: 1px solid var(--rule); }
.facets a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facets a:hover { text-decoration: underline; }
.tally { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.pager { display: flex; gap: 1.25rem; padding: 1.5rem 0 0; border-top: 1px solid var(--rule); font-size: var(--fs-small); color: var(--ink-soft); }

.empty { padding: .5rem 0 3rem; max-width: var(--measure); }
.empty p { color: var(--ink-soft); margin: 0 0 1rem; }

/* --- Message ------------------------------------------------------------- */

.dochead { padding: 2rem 0 1rem; }
.crumb { font-size: var(--fs-small); color: var(--ink-soft); margin: 0 0 .75rem; }
.dochead h1 {
  font-family: var(--type); font-weight: 700; font-size: var(--fs-h1);
  line-height: 1.2; letter-spacing: -.01em; margin: 0; max-width: 40ch;
}

.message-grid { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 60rem) { .message-grid { grid-template-columns: minmax(0, 1fr) 19rem; } }

.headers { font-size: var(--fs-small); margin: 0 0 1.5rem; }
.headers div { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.headers div:first-child { border-top: 1px solid var(--rule); }
.headers dt { color: var(--ink-soft); }
.headers dd { margin: 0; }
.headers .more { color: var(--ink-soft); }

.letter {
  background: var(--paper); border: 1px solid var(--rule);
  padding: 1.5rem 1.75rem; margin: 0;
  font-family: var(--type); font-size: .9375rem; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; max-width: 46rem;
}
.letter.blank { color: var(--ink-faint); font-family: var(--sans); font-size: var(--fs-small); }

details.quoted { margin: 1rem 0 0; max-width: 46rem; }
details.quoted summary { cursor: pointer; font-size: var(--fs-small); color: var(--ink-soft); padding: .4rem 0; }
details.quoted summary:hover { color: var(--ink); }
details.quoted .letter { color: var(--ink-soft); border-style: dashed; }

.side h2 { font-size: var(--fs-small); font-weight: 600; margin: 0 0 .5rem; }
.side ol, .side ul { list-style: none; margin: 0 0 2rem; padding: 0; font-size: var(--fs-small); }
.side li { padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.side li:first-child { border-top: 1px solid var(--rule); }
.side li a { text-decoration: none; }
.side li a:hover { text-decoration: underline; }
.side .sub { display: block; color: var(--ink-soft); font-size: var(--fs-micro); }
.side li[aria-current] { font-weight: 600; }
.side .path { font-family: var(--type); font-size: var(--fs-micro); color: var(--ink-soft); }
.side p { font-size: var(--fs-small); color: var(--ink-soft); margin: 0 0 1rem; }

/* --- Person -------------------------------------------------------------- */

.person-head { padding: 2rem 0 1.25rem; }
.person-head h1 { font-size: var(--fs-h1); font-weight: 600; letter-spacing: -.02em; margin: 0 0 .25rem; }
.person-head .addr { font-family: var(--type); color: var(--ink-soft); margin: 0 0 .75rem; }
.person-head .facts { font-size: var(--fs-small); color: var(--ink-soft); margin: 0; }
.person-head .facts a { color: var(--ink); }
.person .tl { --tl-h: 6rem; margin: 0 0 2.5rem; }
.correspondents { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 52rem) { .correspondents { grid-template-columns: 1fr 1fr; } }
.correspondents h2 { font-size: var(--fs-small); font-weight: 600; margin: 0 0 .5rem; }
.correspondents ol { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.correspondents li {
  display: grid; grid-template-columns: minmax(0, 1fr) 6rem 3.5rem; gap: .75rem;
  align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--rule);
}
.correspondents li:first-child { border-top: 1px solid var(--rule); }
.correspondents a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correspondents a:hover { text-decoration: underline; }
.meter { height: .4rem; background: var(--rule); }
.meter i { display: block; height: 100%; background: var(--bar); }
.correspondents .tally { text-align: right; }

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

footer.foot { border-top: 1px solid var(--rule); margin-top: 2rem; padding: 1.5rem 0 3rem; font-size: var(--fs-small); color: var(--ink-faint); }
footer.foot p { margin: 0 0 .4rem; max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
