html {
    --line-size: 3vh;
    --pre-size: 2vh;
    --table-size: 2.5vh;
    --caption-size: 2.5vh;
}

@media (min-width: 420px) {
    html {
        --line-size: 5vh;
        --pre-size: 5vh;
        --table-size: 4vh;
        --caption-size: 4vh;
    }
}

@media (min-width: 780px) {
    html {
        --line-size: 5vh;
        --pre-size: 5vh;
        --table-size: 4vh;
        --caption-size: 4vh;
    }
}

@media (min-width: 1024px) {
    html {
        --line-size: 5vh;
        --pre-size: 3vh;
        --table-size: 4vh;
        --caption-size: 4vh;
    }
}

@media (min-width: 2048px) {
    html {
        --line-size: 7vh;
        --pre-size: 5vh;
        --table-size: 6vh;
        --caption-size: 4vh;
    }
}

 html { font-size: var(--line-size);  }
  pre { font-size: var(--pre-size);   }
table { font-size: var(--table-size); }
caption, figcaption {
    font-size: var(--caption-size);
}

html, body, article, article > section {
    margin: 0;
    padding: 0;
    height: 100%;
}

article > section {
    margin: 0;
    padding: 0 1ch;
    padding-top: env(safe-area-inset-top);
    padding-right: max(1ch, env(safe-area-inset-right));
    padding-bottom: max(1ch, env(safe-area-inset-bottom));
    padding-left: max(1ch, env(safe-area-inset-left));
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

article > section li {
    margin-left: 1ch;
}

article > section {
    display: none;
}

article > section.current {
    display: flex;
}

article > section > * {
    margin: 0.5em 0;
    flex: 1;
}

article > section > header,
article > section > footer {
    margin: 0;
    width: 100%;
    flex: 100 var(--line-size);
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

article > section > header {
    align-self: start;
    align-items: flex-start;
}

article > section > footer {
    align-self: end;
    align-items: flex-end;
}

article > section > header > *, article > section > footer > * {
    margin: 0;
    padding: 0;
    flex: 1;
    text-align: center;
}

/* :last-child has to come before :first-child because, in the "there is
   ony one child" case, you want things on the left, not the right. */

article > section > header > *:last-child,
article > section > footer > *:last-child {
    text-align: right;
}

article > section > header > *:first-child,
article > section > footer > *:first-child {
    text-align: left;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: normal;
}

article > section > h1 {
    font-size: 1.75em;
}

article > section > h2 {
    font-size: 1.5em;
}

article > section > h3 {
    font-size: 1.25em;
}

article > section > h4,
article > section > h5,
article > section > h6 {
    font-size: 1em;
}

article > section > header,
article > section > footer,
article > section > header code,
article > section > footer code {
    font-size: 16pt;
}

figure {
    margin: 0;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 100%;
}

figure > * {
    flex: 1;
}

figure > img {
    aspect-ratio: auto;
    max-height: 80vh;
    width: auto;
}

table {
    table-layout: fixed;
    border-collapse: collapse;
}

caption {
    caption-side: top;
    border-bottom: none;
    font-weight: bold;
}

caption, td, th {
    padding: 0.25em;
}

td, th {
    vertical-align: top;
    border: 1px solid currentColor;
}
