:root {
    --h1-font-size: 5rem;
    --h1-line-height: 6rem;

    --h2-font-size: 2.5rem;
    --h2-line-height: 3.5rem;

    --h3-font-size: 1.5rem;
    --h3-line-height: 1.5;

    --h4-font-size: 1.125rem;
    --h4-line-height: 1.5;

    --h5-font-size: 1rem;
    --h5-line-height: 1.5;

    --subtext1-font-size: 1.5rem;
    --subtext1-line-height: 2rem;

    --subtext2-font-size: 1.125rem;
    --subtext2-line-height: 1.5;
}

html {
    font-size: 16px;
    font-family: "Atkinson Hyperlegible", sans-serif;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.5;
}

@media (max-width: 768px) {
    :root {
        --h1-font-size: 3rem;
        --h1-line-height: 4rem;

        --h2-font-size: 2rem;
        --h2-line-height: 2.5rem;

        --subtext1-font-size: 1.25rem;
        --subtext1-line-height: 1.375;
    }
}

h1,
h2,
h3 {
    font-family:
        "FormaDJRDisplay",
        -apple-system,
        BlinkMacSystemFont,
        avenir next,
        avenir,
        segoe ui,
        helvetica neue,
        helvetica,
        Cantarell,
        Ubuntu,
        roboto,
        noto,
        arial,
        sans-serif;
    color: var(--text-color-headers);
    font-weight: 500;
    letter-spacing: 0.03em;
    margin: 0;
    margin-left: -0.015em;
}

h4,
h5,
h6 {
    font-family:
        "FormaDJRText",
        -apple-system,
        BlinkMacSystemFont,
        avenir next,
        avenir,
        segoe ui,
        helvetica neue,
        helvetica,
        Cantarell,
        Ubuntu,
        roboto,
        noto,
        arial,
        sans-serif;
    color: var(--text-color-headers);
    font-weight: 500;
    letter-spacing: 0.03em;
    margin: 0;
}

h1 {
    font-size: var(--h1-font-size);
    line-height: var(--h1-line-height);
}

h2,
h3 {
    font-size: var(--h2-font-size);
    line-height: var(--h2-line-height);
}

.subtext1 {
    margin-top: 16px;
    font-size: var(--subtext1-font-size);
    line-height: var(--subtext1-line-height);
    color: var(--text-color-muted);
}

.subtext2 {
    margin-top: 12px;
    font-size: var(--subtext2-font-size);
    line-height: var(--subtext2-line-height);
}

h4 {
    font-size: var(--h4-font-size);
    line-height: var(--h4-line-height);
}

h5 {
    font-style: normal;
    font-size: var(--h5-font-size);
    line-height: var(--h5-line-height);
}

h3 + p,
h4 + p,
h5 + p {
    margin-top: 12px;
}

h2 + .subtext1 {
    margin-top: 8px;
}

p + p {
    margin-top: 20px;
}

ul + p,
ol + p,
p + ul,
p + ol {
    margin-top: 20px;
}

ol > li + li,
ul > li + li {
    margin-top: 20px;
}

ol ol > li + li,
ul ul > li + li,
ol ul > li + li,
ul ol > li + li {
    margin-top: 8px;
}

a {
    color: var(--text-color) !important;
    text-decoration: none !important;
}

p a,
li a {
    font-style: normal;
    text-decoration: underline !important;
    text-decoration-color: var(--link-underline);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    text-decoration-skip-ink: auto;
    transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

p a:hover,
li a:hover {
    text-decoration-color: var(--text-color);
    color: var(--text-color-headers) !important;
}

b {
    font-weight: 600 !important;
}

hr {
    display: block;
    border: none;
    border-top: 1px solid var(--text-color);
    opacity: 0.3;
    margin-left: 64px;
    margin-right: 64px;
    width: calc(100% - 128px);
}

@media (max-width: 768px) {
    hr {
        margin-left: 32px !important;
        margin-right: 32px !important;
        width: calc(100% - 64px) !important;
    }
}


/* Things I'm otherwise scared to add to this CSS. */

.prose hr {
    display: block;
    border: none;
    border-top: 1px solid var(--text-color);
    opacity: 0.3;
    margin: 32px 0;
    width: 100%;
}

.prose hr::before {
    content: none;
}

.prose {
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        margin-top: 24px;
    }
}

.prose blockquote {
    padding: 0 1em;
    border-left: 0.25em solid #d1d9e0;
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose blockquote > * {
    opacity: 0.9;
}

.prose blockquote > :first-child {
    margin-top: 0;
}

.prose blockquote > :last-child {
    margin-bottom: 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px 0;

    -webkit-user-drag: none;
    user-select: none;

    background-color: var(--background-color);
    border: 0.5px solid rgb(0, 0, 0, 0.4);
    border-radius: 5px;
}


.prose pre {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.prose code {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.875rem;
}

.prose pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

.prose p code,
.prose li code {
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.875rem;
}
