@font-face {
    font-family: 'Inter';
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
    font-named-instance: 'Regular';
}

@font-face {
    font-family: 'Inter';
    font-weight: 100 900;
    font-display: swap;
    font-style: italic;
    font-named-instance: 'Italic';
}

:root {
    --xxs: calc(0.125 * var(--md));
    --xs: calc(0.25 * var(--md));
    --sm: calc(0.5 * var(--md));
    --md: 1rem;
    --lg: calc(2 * var(--md));
    --xl: calc(4 * var(--md));
    --xxl: calc(8 * var(--md));

    --gap: var(--md);
    --gutter: var(--lg);

    --frame:
        max(env(safe-area-inset-top), var(--lg))
        max(env(safe-area-inset-right), calc(0.75 * var(--md)))
        max(env(safe-area-inset-bottom), var(--lg))
        max(env(safe-area-inset-left), calc(0.75 * var(--md)));

    --cols: repeat(1, minmax(0, 1fr));

    --text-stack: Inter, system-sans, system-ui, sans-serif;
    --text-settings: 'kern' 1, 'liga' 1, 'case' 1, 'dlig' 1, 'ss03' 1;
    --text-measure: 70ch;
    --text-size: max(1em, 1.2vw);
    --text-size-mob: max(1.2em, 1.5vw);
    --text-height: 1.7;
    --text-spacing: -0.011em;

    --bold: 600;

    --hue: 200;
    --canvas: hsl(var(--hue) 2% 97%);
    --text-on-canvas: hsl(var(--hue) 10% 10%);
    --link-on-canvas: hsl(var(--hue) 20% 20%);
    --decoration-on-canvas: hsl(var(--hue) 10% 90%);

    --border: 1px solid var(--decoration-on-canvas);
    --shadow:
      0px 0.2px 0.9px rgba(0, 0, 0, 0.003),
      0px 0.5px 2px rgba(0, 0, 0, 0.004),
      0px 0.7px 3.5px rgba(0, 0, 0, 0.006),
      0px 1.1px 5.3px rgba(0, 0, 0, 0.007),
      0px 1.5px 7.8px rgba(0, 0, 0, 0.008),
      0px 2.1px 11.4px rgba(0, 0, 0, 0.009),
      0px 2.8px 16.8px rgba(0, 0, 0, 0.011),
      0px 4px 25.6px rgba(0, 0, 0, 0.014),
      0px 5.8px 41.3px rgba(0, 0, 0, 0.018),
      0px 8px 73px rgba(0, 0, 0, 0.02);

}

body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gutter);

    min-height: 100vh;
    max-width: var(--text-measure);
    margin: auto;
    padding: var(--frame);
}

body > main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gutter);
}


@media (prefers-color-scheme: dark) {
    :root {
        --canvas: hsl(var(--hue) 2% 7%);
        --text-on-canvas: hsl(var(--hue) 4% 88%);
        --link-on-canvas: hsl(var(--hue) 6% 66%);
        --decoration-on-canvas: hsl(var(--hue) 2% 15%);
    }
}

@media (min-width: 600px) {
    :root {
        --frame:
            max(env(safe-area-inset-top), var(--xxl))
            max(env(safe-area-inset-right), var(--lg))
            max(env(safe-area-inset-bottom), var(--xxl))
            max(env(safe-area-inset-left), var(--lg));
    }
}

@media (min-width: 900px) {
    :root {
        --cols: repeat(2, minmax(0, 1fr));
    }
}

/* We break it down to build it up again */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;

    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    font-family: inherit;
    letter-spacing: inherit;
    color: inherit;
    vertical-align: baseline;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-font-smoothing: subpixel-antialiased;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    font-family: var(--text-stack);
    font-size: var(--text-size);
    font-feature-settings: var(--text-settings);
    letter-spacing: var(--text-spacing);
    line-height: var(--text-height);
    color-scheme: light dark;
    color: var(--text-on-canvas);
    background-color: var(--canvas);
    hanging-punctuation: first;
}

main, article {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gutter);
}

:is(main,article) :is(section, aside, footer) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
}

header p {
    color: var(--link-on-canvas);
}

h1, h2, h3 {
    font-weight: var(--bold);
}

h4, h5, h6 {
    display: none;
}

h3 {
    font-style: italic;
}

* + h2 {
    margin-top: var(--gap);
}

b, strong {
    font-weight: var(--bold);
}

i, em {
    font-style: italic;
}

a {
    color: var(--link-on-canvas);
    text-decoration: underline;
    -webkit-text-decoration-color: var(--decoration-on-canvas);
            text-decoration-color: var(--decoration-on-canvas);
}

a:hover {
    color: unset;
    -webkit-text-decoration-color: unset;
            text-decoration-color: unset;
}

:is(h1, h2, h3) > a {
    color: unset;
    text-decoration: none;
}


ul {
    list-style: circle;
    list-style-position: inside;
}


ol {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    list-style-position: inside;
    counter-reset: ordered-list;
}

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

ol ::marker {
    content: counter(ordered-list) '\20dd  ';
}

ul li,
dl dd {
    margin-top: 0;
}

img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    -ms-interpolation-mode: bicubic;
}

nav * {
    display: block;
}


.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


@media not screen and (hover: hover) {

    abbr[title] {
        text-decoration: none;
    }

    abbr[title]:after {
        content: ' (' attr(title) ')';
    }

}

@media screen and (hover: hover) {

    abbr[title] {
        -webkit-text-decoration: underline dotted;
                text-decoration: underline dotted;
        -webkit-text-decoration-color: var(--decoration-on-canvas);
                text-decoration-color: var(--decoration-on-canvas);
        cursor: help;
    }

}

pre,
code {
    font-family: Menlo, Courier, monospace;
}

pre {
    white-space: pre;
    white-space: pre-wrap;
    white-space: pre-line;
    word-wrap: break-word;

    padding: var(--gap) calc(var(--gap));
    border: var(--border);
    max-width: calc(100% + 2 * 0.75 * var(--gap));
    overflow-x: auto;
}

:not(figure) > pre {
    margin-left: calc(-1 * var(--gap));
    margin-right: calc(-1 * var(--gap));
}

code[class*='language-'],
pre[class*='language-'] {
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    -moz-tab-size: 4;
      -o-tab-size: 4;
         tab-size: 4;
    -webkit-hyphens: none;
        -ms-hyphens: none;
            hyphens: none;
}

pre[class*='language-'] {
}

/* Inline code */

:not(pre) > code {
    padding: 0.075em 0.25em;
    white-space: normal;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula,
.hljs-comment,
.hljs-quote,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
    color: var(--link);
}

.hljs-comment,
.hljs-quote {
    font-style: italic;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

@media only screen and (max-width: 600px) {
    :root {
        font-size: var(--text-size-mob);
    }
}
