:root {
  color-scheme: light dark;
  --body-padding: 2ch;
  --line-height-multiplier: 1.5;
  --basic-vertical-margin: calc(var(--line-height-multiplier) * 1rem);
  --font-family: "Helvetica Neue", Arial, sans-serif;
  --font-family-monospace: "Courier Prime", Courier, monospace;
  --font-size: 16px;

  --background-color:   light-dark( oklch(0.95 0.05 200), oklch(0.20 0.02 200) );
  --color:              light-dark( oklch(0    0    200), oklch(0.95 0.05 200) );
  --link-color:         light-dark( oklch(0.40 0.16 260), oklch(0.75 0.10 260) );
  --link-visited-color: light-dark( oklch(0.40 0.16 320), oklch(0.75 0.10 320) );
  --link-active-color:  light-dark( oklch(0.50 0.20  20), oklch(0.80 0.10  20) );
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  padding: var(--body-padding);
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--basic-vertical-margin);

  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: var(--line-height-multiplier);

  background-color: var(--background-color);
  color: var(--color);
}

body.dynamic-content {
  justify-content: start;
}

header, main, aside, footer {
  max-width: 42ch;
  width: 100%;
}

h1, h2, h3 {
  margin: var(--basic-vertical-margin) 0;

  text-transform: uppercase;

  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;

  text-wrap: balance;
}

h1 {
  font-size: 1.5em;
}

h2 {
  font-size: 1.25em;
}

:first-child {
  margin-top: 0;
}

:last-child {
  margin-bottom: 0;
}

p {
  margin: var(--basic-vertical-margin) 0;
  hyphens: auto;
}

p.attribution {
  text-align: right;
}

blockquote {
  margin: 0;
}

blockquote:lang(fr)::before {
  content: "«\a0";
}

blockquote:lang(fr)::after {
  content: "\a0»"
}

blockquote + figcaption::before {
  content: "—\a0";
}

ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

ol li {
  counter-increment: list-items;
}

ol li::before {
  content: counter(list-items) "\a0: ";
}

ul {
  list-style: "– ";
  padding-left: 1em;
}

dd {
  margin-left: 4ch;
}

input, textarea, select, button {
  font-family: var(--font-family);
  font-size: inherit;
  box-sizing: border-box;
  border: 2px solid;
  color: inherit;
  background-color: inherit;
  border-radius: 4px;
}

button {
  padding: 0.5em;
  font-weight: 700;
  text-align: center;
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--link-active-color);
  border-radius: 4px;
}

label {
  font-weight: 400;
}

code {
  font-family: var(--font-family-monospace);
}

.fullwidth {
  width: 100%;
}

.no-display {
  display: none;
}

details {
  margin: var(--basic-vertical-margin) 0;
}

summary {
  cursor: pointer;
}

a:link {
  color: var(--link-color);
  text-decoration-thickness: 1px;
}

a:visited {
  color: var(--link-visited-color);
}

a:active {
  color: var(--link-active-color);
}

a:any-link.discrete-link {
  text-decoration: none;
  color: currentColor;
}

figure {
  margin: var(--basic-vertical-margin) 0;
}

figcaption {
  margin-left: 25%;
  margin-top: calc(var(--basic-vertical-margin) / 2);
  text-align: right;
}

body.table-intensive main {
  max-width: 100ch;
}

table {
  border-spacing: 0.5em;
  margin: -0.5em;
}

tbody th {
  text-align: right;
}

tbody th, tbody tr {
  vertical-align: top;
}

pre {
  font-family: var(--font-family-monospace);
}
