:root {
  --ink: #39271a;
  --bark: #5b3a24;
  --brown: #7d4b25;
  --amber: #e8a83f;
  --gold: #ffd66d;
  --cream: #fff5d7;
  --paper: #fbebc1;
  --sage: #506f4b;
  --blue: #3e6e7f;
  --coral: #bc5d3d;
  --maroon: #5b2728;
  --page-start: #fff1cf;
  --page-mid: #f5d89f;
  --page-end: #efca83;
  --shadow: 0 22px 70px rgba(70, 44, 22, .14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='96' viewBox='0 0 112 96'%3E%3Cpath d='M28 2h56l26 46-26 46H28L2 48Z' fill='none' stroke='%235b3a24' stroke-width='1.05' stroke-linejoin='round' opacity='.042'/%3E%3C/svg%3E") 0 0 / 112px 96px fixed,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='96' viewBox='0 0 112 96'%3E%3Cpath d='M28 2h56l26 46-26 46H28L2 48Z' fill='none' stroke='%235b3a24' stroke-width='1.05' stroke-linejoin='round' opacity='.026'/%3E%3C/svg%3E") 56px 48px / 112px 96px fixed,
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, .34), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(232, 168, 63, .08), transparent 28rem),
    linear-gradient(120deg, var(--page-start), var(--page-mid) 58%, var(--page-end));
}

body {
  width: min(68ch, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px) 0 clamp(70px, 10vw, 120px);
  font-family: "Charter", "Iowan Old Style", Georgia, serif;
  font-size: clamp(1.075rem, 1.02rem + .18vw, 1.18rem);
  line-height: 1.58;
}

body::before {
  display: block;
  width: clamp(42px, 6vw, 58px);
  height: clamp(42px, 6vw, 58px);
  margin: 0 auto clamp(10px, 2vw, 18px);
  background: url("assets/generated-wax-seal.png") center / contain no-repeat;
  filter: drop-shadow(0 8px 10px rgba(91, 58, 36, .14));
  content: "";
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 1.35em 0 .35em;
  color: var(--maroon);
  font-family: "Iowan Old Style", "Palatino", Georgia, serif;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  margin-top: 0;
  font-size: clamp(2.85rem, 2.2rem + 3vw, 5rem);
  line-height: 1.06;
  text-wrap: balance;
}

body > h1:first-of-type {
  margin-bottom: clamp(1.8rem, 3.6vw, 2.8rem);
  text-align: center;
}

body > h1:first-of-type + p {
  margin-top: 0;
}

h2 {
  margin-top: 1.25em;
  font-size: clamp(2rem, 1.65rem + 1.4vw, 3rem);
}

h3 {
  margin-top: 1.05em;
  font-size: clamp(1.45rem, 1.25rem + .8vw, 2rem);
}

h2 + p,
h3 + p,
h4 + p {
  margin-top: .55em;
}

p,
ul,
ol,
blockquote,
pre,
table,
figure,
details {
  margin: 1.22em 0;
}

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

p {
  text-wrap: pretty;
}

a {
  color: var(--maroon);
  font-weight: 600;
  text-decoration-color: rgba(91, 39, 40, .28);
  text-decoration-thickness: .055em;
  text-underline-offset: .18em;
}

a:hover {
  color: var(--ink);
  text-decoration-color: #9d3c35;
}

ul,
ol {
  margin-top: .85em;
  margin-bottom: 1.45em;
  padding-left: 1.35em;
}

li + li {
  margin-top: .35em;
}

strong {
  font-weight: 600;
}

blockquote {
  padding: .15em 0 .15em 1.1em;
  border-left: 5px solid rgba(232, 168, 63, .7);
  color: #51351f;
  font-size: 1.08em;
}

code,
kbd,
samp {
  border: 1px solid rgba(91, 58, 36, .1);
  border-radius: .25rem;
  background: rgba(255, 245, 215, .34);
  color: #51351f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .86em;
}

code {
  padding: .06em .24em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid rgba(91, 58, 36, .16);
  border-radius: .5rem;
  background: rgba(255, 245, 215, .78);
  box-shadow: var(--shadow);
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

hr {
  height: 2px;
  margin: 2.5rem 0;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(91, 58, 36, .32), transparent);
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

figure {
  margin-right: 0;
  margin-left: 0;
}

figcaption {
  margin-top: .55rem;
  color: #51351f;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: .9rem;
  line-height: 1.4;
}

table {
  width: min(calc(100vw - 32px), 920px);
  margin-right: 50%;
  margin-left: 50%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: .5rem;
  background: rgba(255, 245, 215, .66);
  box-shadow: 0 0 0 1px rgba(91, 58, 36, .14);
  font-size: .98em;
  line-height: 1.42;
  transform: translateX(-50%);
}

th,
td {
  padding: .55rem .7rem;
  border-bottom: 1px solid rgba(91, 58, 36, .14);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(255, 214, 109, .38);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: .9em;
  line-height: 1.25;
  white-space: nowrap;
}

td:first-child,
th:first-child {
  white-space: nowrap;
}

table:has(th:nth-child(8)) td:nth-child(3),
table:has(th:nth-child(8)) td:nth-child(4),
table:has(th:nth-child(8)) td:nth-child(5),
table:has(th:nth-child(8)) td:nth-child(6),
table:has(th:nth-child(8)) td:nth-child(7),
table:has(th:nth-child(8)) th:nth-child(3),
table:has(th:nth-child(8)) th:nth-child(4),
table:has(th:nth-child(8)) th:nth-child(5),
table:has(th:nth-child(8)) th:nth-child(6),
table:has(th:nth-child(8)) th:nth-child(7) {
  white-space: nowrap;
}

td code {
  font-size: .9em;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

details {
  padding: .8rem 1rem;
  border: 1px solid rgba(91, 58, 36, .18);
  border-radius: .5rem;
  background: rgba(255, 245, 215, .66);
}

summary {
  cursor: pointer;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 600;
}

button,
input,
select,
textarea {
  font: inherit;
}

label {
  display: block;
  margin: 1rem 0 .35rem;
  color: var(--bark);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: .92em;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: .62rem .72rem;
  border: 1px solid rgba(91, 58, 36, .26);
  border-radius: .42rem;
  background: rgba(255, 245, 215, .72);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(91, 58, 36, .06);
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(91, 39, 40, .58);
  outline: 3px solid rgba(232, 168, 63, .28);
  background: rgba(255, 250, 232, .88);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: .35rem;
  accent-color: var(--maroon);
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  width: auto;
  padding: .58rem .9rem;
  border: 1px solid rgba(91, 39, 40, .42);
  border-radius: .45rem;
  background: linear-gradient(180deg, #8b3d30, var(--maroon));
  color: var(--cream);
  box-shadow: 0 5px 14px rgba(91, 39, 40, .16);
  cursor: pointer;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 600;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: linear-gradient(180deg, #6d302d, #4d2022);
}

button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible {
  outline: 3px solid rgba(232, 168, 63, .45);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .62;
}

@media (max-width: 620px) {
  body {
    width: min(100% - 28px, 68ch);
    padding-top: 34px;
  }

  table {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-left: 0;
    overflow-x: auto;
    transform: none;
  }
}
