/*
  Revival Engineer
  One stylesheet. No framework, no web fonts, no build step.

  The site is set like a book: a title page, a single column of text,
  and a colophon. Colors are inks on paper.
*/

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --ink: #1a2238;       /* blue-black, the ink contracts are signed in */
  --ink-soft: #586079;  /* dates, captions, secondary text */
  --ballpoint: #2442b0; /* links */
  --pencil: #b9cde6;    /* rules and selection: the editor's blue pencil */

  --serif: "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --measure: 33rem;     /* about 70 characters per line */
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a2b;
    --ink: #e4e7ef;
    --ink-soft: #a3abbe;
    --ballpoint: #a2b8ff;
    --pencil: #3b4b6d;
  }
}

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

html {
  font-size: 118.75%; /* 19px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 48em) {
  html {
    font-size: 125%; /* 20px */
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--pencil);
  color: var(--ink);
}

a {
  color: var(--ballpoint);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 2px solid var(--ballpoint);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  top: -10rem;
  left: var(--gutter);
  padding: 0.5rem 0.75rem;
  background: var(--paper);
}

.skip:focus {
  top: 0.75rem;
}

/* One column, one measure. */

.masthead,
main,
.colophon {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
}

.masthead ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.masthead li {
  margin: 0;
}

/* On the home page the nav is a running head, centered over the title page. */
.masthead-home,
.masthead-home ul {
  justify-content: center;
}

.wordmark {
  color: var(--ink);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.masthead nav a {
  color: var(--ink-soft);
  font-size: 0.8333rem;
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Small screens: the four links fit on one line down to 375px. */
@media (max-width: 30em) {
  .masthead ul {
    column-gap: 0.75rem;
  }

  .masthead nav a {
    font-size: 0.8rem;
  }
}

main {
  padding-bottom: 1rem;
}

/* Type scale: 15, 16.7, 20, 23.3, 26.7, 30, 40 and up (base 20px). */

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 3rem 0 1rem;
  font-size: 2rem;
  letter-spacing: -0.005em;
}

h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.5rem;
}

h3 {
  margin: 2rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

p,
li,
dd {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.5rem;
}

ul {
  list-style-type: "–  ";
}

li {
  margin-bottom: 0.35rem;
}

li::marker {
  color: var(--ink-soft);
}

.lede {
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.1667rem);
  line-height: 1.5;
}

.updated {
  color: var(--ink-soft);
  font-size: 0.8333rem;
  font-style: italic;
}

/* The title page. The blank author line is the one bold thing on the site. */

.title-page {
  padding-block: clamp(3rem, 12vh, 7rem) clamp(3.5rem, 10vh, 5.5rem);
  text-align: center;
}

.title-page h1 {
  margin: 0;
  font-size: clamp(2.5rem, 1rem + 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.subtitle {
  max-width: 22em;
  margin: 1.1rem auto 0;
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.3333rem);
  font-style: italic;
  line-height: 1.35;
  text-wrap: balance;
}

.byline {
  margin: clamp(2.5rem, 8vh, 4.5rem) 0 0;
  font-size: 1.1667rem;
  font-style: italic;
}

.signature {
  position: relative;
  display: inline-block;
  width: 9em;
  margin-left: 0.35em;
  border-bottom: 1px solid currentColor;
}

.signature-label {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  padding-top: 0.4em;
  color: var(--ink-soft);
  font-size: 0.65em;
  letter-spacing: 0.02em;
}

/* Small screens: keep the first lines of text and the apply link above the fold. */
@media (max-width: 30em) {
  .title-page {
    padding-block: 3.25rem 3.5rem;
  }

  .byline {
    margin-top: 2.75rem;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.75rem;
  margin: 1.75rem 0 0;
}

.action-primary {
  font-size: 1.1667rem;
}

/* A dictionary entry for a new term. */

.entry {
  margin: 2rem 0 2.5rem;
}

.entry dt {
  margin-top: 1.25rem;
  font-size: 1.1667rem;
}

.entry dt:first-child {
  margin-top: 0;
}

.entry dfn {
  font-style: normal;
  font-weight: 700;
}

.pos {
  margin-left: 0.4em;
  color: var(--ink-soft);
  font-size: 0.8571em;
  font-style: italic;
}

.entry dd {
  margin: 0.15rem 0 0 1.5rem;
}

.terms dt {
  font-weight: 700;
}

.terms dd {
  margin: 0 0 1rem;
}

/* The fee: a displayed formula and a book-style table. */

.formula {
  margin: 2rem 0;
  font-size: 1.3333rem;
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}

caption {
  caption-side: bottom;
  padding-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.8333rem;
  font-style: italic;
  text-align: left;
}

th,
td {
  padding: 0.45rem 0;
  text-align: left;
}

th {
  border-bottom: 1px solid var(--ink);
  font-style: italic;
  font-weight: 400;
}

th:last-child,
td:last-child {
  text-align: right;
}

/* Sources, set like footnotes. */

.evidence li {
  margin-bottom: 0.75rem;
}

sup {
  font-size: 0.7em;
  line-height: 0;
}

sup a {
  padding: 0 0.15em;
  text-decoration: none;
}

.sources {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.8333rem;
}

.note {
  color: var(--ink-soft);
  font-size: 0.8333rem;
  font-style: italic;
}

/* The colophon closes every page, as it closes a book. */

.colophon {
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--pencil);
  color: var(--ink-soft);
  font-size: 0.8333rem;
}

.colophon h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-style: italic;
}

.colophon p {
  margin-bottom: 0.5rem;
}

.colophon a {
  color: inherit;
}
