/* The homepage's ink and paper, swapped at night; a sheet a shade lighter
   than the paper it lies on, white by day; and the homepage's purple for a
   link being pointed at. Greys are the ink at partial strength. */
:root {
  --ink: 25 33 38;
  --paper: 250 248 245;
  --sheet: 255 255 255;
  --lift: 0 1px 2px rgb(25 33 38 / 0.06), 0 8px 28px rgb(25 33 38 / 0.07);
  --hover: #6d4f74;
  --hover-line: rgba(109, 79, 116, 0.34);
  --quiet: rgb(var(--ink) / 0.62);
  --hair: rgb(var(--ink) / 0.14);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: 250 248 245;
    --paper: 25 33 38;
    --sheet: 33 42 48;
    --lift: 0 0 0 1px rgb(250 248 245 / 0.05);
    --hover: #cdb9d1;
    --hover-line: rgba(205, 185, 209, 0.34);
  }
}

/* The page is the desk; the body is one sheet lying on it, set in the
   system's Helvetica or Arial, as statements are. */
html {
  background: rgb(var(--paper));
  color: rgb(var(--ink));
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  box-sizing: border-box;
  width: min(832px, 100% - 24px);
  margin: clamp(12px, 2vw, 24px) auto;
  padding: clamp(18px, 6vw, 56px);
  background: rgb(var(--sheet));
  box-shadow: var(--lift);
  font-size: 14px;
  line-height: 1.55;
}

p,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  /* A hairline under every link, and the homepage's purple line drawn over
     it while the link is pointed at. */
  background:
    linear-gradient(var(--hover-line) 0 0) right bottom / 0 1px no-repeat,
    linear-gradient(rgb(var(--ink) / 0.3) 0 0) left bottom / 100% 1px no-repeat;
  transition: color 0.2s ease, background-size 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

a:hover {
  color: var(--hover);
  background-position: left bottom;
  background-size: 100% 1px;
}

time,
dd,
table {
  font-variant-numeric: tabular-nums;
}

/* Issuer on the left, the document on the right, over a heavy rule. */
.head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px 40px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgb(var(--ink));
}

.mark {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.issuer p + p {
  margin-top: 8px;
  color: var(--quiet);
  font-size: 12px;
}

.doc h1 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.doc dl {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: 1px 14px;
  font-size: 12px;
}

.doc dt,
.fields dt {
  color: var(--quiet);
}

main > * {
  margin-top: 30px;
}

h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(var(--ink));
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.fields {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  gap: 2px 16px;
}

.letter p + p {
  margin-top: 10px;
}

/* Figures to the right, a single rule over the total and a double one under it. */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 7px 0;
  text-align: left;
  vertical-align: baseline;
}

thead th {
  padding-top: 0;
  border-bottom: 1px solid rgb(var(--ink));
  color: var(--quiet);
  font-size: 12px;
  font-weight: 700;
}

tbody td,
tbody th {
  border-bottom: 1px solid var(--hair);
  font-weight: 400;
}

.no {
  width: 3em;
  padding-right: 1em;
  text-align: right;
}

.date {
  width: 7.5em;
  text-align: right;
}

.size {
  width: 6em;
  text-align: right;
}

.none {
  color: var(--quiet);
}

tfoot th,
tfoot td {
  padding-top: 9px;
  font-weight: 700;
}

tfoot td {
  border-top: 1px solid rgb(var(--ink));
  border-bottom: 3px double rgb(var(--ink));
}

/* The asterisks are drawn, and read as nothing. The left padding balances the
   letter-spacing after the last asterisk. */
.end {
  margin-top: 16px;
  padding-left: 0.18em;
  color: var(--quiet);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.end::before {
  content: "*** ";
  content: "*** " / "";
}

.end::after {
  content: " ***";
  content: " ***" / "";
}

.terms ol {
  margin: 8px 0 0;
  padding-left: 2.2em;
}

.terms li {
  margin-top: 3px;
  padding-left: 0.3em;
}

.terms li::marker {
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

/* Room for a signature that the statement does not need. */
.sign {
  margin-top: 26px;
  font-weight: 700;
}

.info {
  color: var(--quiet);
  font-size: 12px;
}

.info h2 {
  color: rgb(var(--ink));
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 36px;
  padding-top: 8px;
  border-top: 2px solid rgb(var(--ink));
  color: var(--quiet);
  font-size: 11px;
}

@media (max-width: 560px) {
  .head {
    grid-template-columns: 1fr;
  }

  .doc h1 {
    text-align: left;
  }

  .doc dl {
    justify-content: start;
  }

  .fields {
    grid-template-columns: 7.5em 1fr;
  }
}

/* On paper: the day's ink whatever the screen, no link lines, and small
   enough that page 1 of 1 stays true on A4 and on Letter. */
@page {
  margin: 14mm;
}

@media print {
  :root {
    --ink: 25 33 38;
    --paper: 250 248 245;
  }

  html {
    zoom: 0.75;
  }

  /* The printed page is the sheet. */
  body {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  a {
    background: none;
  }
}
