:root {
    --theme-color-primary: #4a5487;
    --theme-color-text: #000;
    --theme-color-text-alt: #fff;
    --theme-color-background: #FEFEFE;
    --theme-color-background-alt: #4a5487;
    --theme-color-background-code: #f5f5f5;
    --theme-color-focus: #fd0;
    --theme-color-focus-text: #000;
    --theme-color-focus-outline: #000;
    --theme-color-skip-link-focus-outline: #000;
    --theme-color-underline: #B00594;
    --theme-color-link: #082a74;
    --theme-color-link-hover: #003078;
    --theme-color-decoration: #082a74;
    --theme-color-card-background: #f1f2f9;
    --theme-color-card-border: #f1f2f9;
    --theme-color-white: #fff;

    --size-step-0: clamp(1rem, 0.96rem + 0.19vw, 1.125rem);
    --size-step-1: clamp(1.1875rem, 1.11rem + 0.37vw, 1.4375rem);
    --size-step-2: clamp(1.4375rem, 1.34rem + 0.46vw, 1.75rem);
    --size-step-3: clamp(1.75rem, 1.62rem + 0.65vw, 2.1875rem);
    --size-step-4: clamp(2.0625rem, 1.86rem + 1.02vw, 2.75rem);
    --size-step-5: clamp(2.5rem, 2.22rem + 1.39vw, 3.4375rem);
    --size-step-6: clamp(2.5rem, 1.96rem + 2.69vw, 4.3125rem);
    --size-step-7: clamp(3.5625rem, 3.03rem + 2.69vw, 5.375rem);
    --size-step-8: clamp(4.3125rem, 3.61rem + 3.52vw, 6.6875rem);
    --size-step-9: clamp(5.1875rem, 4.24rem + 4.72vw, 8.375rem);

    --leading-flat: 1;
    --leading-fine: 1.15;
    --leading-compact: 1.25;
    --leading-standard: 1.5;
    --leading-loose: 1.7;

    --space-xs: clamp(0.5625rem, 0.54rem + 0.09vw, 0.625rem);
    --space-s: clamp(0.875rem, 0.86rem + 0.09vw, 0.9375rem);
    --space-s-m: clamp(0.875rem, 0.58rem + 1.48vw, 1.875rem);
    --space-m: clamp(1.6875rem, 1.63rem + 0.28vw, 1.875rem);
    --space-l: clamp(2.25rem, 2.18rem + 0.37vw, 2.5rem);
    --space-xl: clamp(3.375rem, 3.26rem + 0.56vw, 3.75rem);

    --font-base: "InterVariable", arial, sans-serif;

    --main-heading-size: 4em;
}

@media (prefers-color-scheme: dark) {
	:root {
		--theme-color-primary: #fff;
        --theme-color-text: #fff;
        --theme-color-background: #000;
        --theme-color-background-alt: #000;
        --theme-color-background-code: #000;
        --theme-color-focus: #fd0;
        --theme-color-focus-outline: #fff;
        --theme-color-underline: #e621c5;
        --theme-color-link: #fff;
        --theme-color-link-hover: #fff;
        --theme-color-decoration: #e621c5;
        --theme-color-card-background: #000;
        --theme-color-card-border: #f1f2f9;
        --theme-color-white: #000;
	}
}

/* Dark mode via class (for manual override) */
body.dark-mode {
	--theme-color-primary: #fff;
	--theme-color-text: #fff;
	--theme-color-background: #000;
	--theme-color-background-alt: #000;
	--theme-color-background-code: #000;
	--theme-color-focus: #fd0;
	--theme-color-focus-outline: #fff;
	--theme-color-underline: #e621c5;
	--theme-color-link: #fff;
	--theme-color-link-hover: #fff;
	--theme-color-decoration: #e621c5;
	--theme-color-card-background: #000;
    --theme-color-card-border: #f1f2f9;
	--theme-color-white: #000;
}

/* Light mode override (when dark mode is system default but user wants light) */
body.light-mode {
	--theme-color-primary: #4a5487;
	--theme-color-text: #000;
	--theme-color-background: #FEFEFE;
	--theme-color-background-alt: #4a5487;
	--theme-color-background-code: #f5f5f5;
	--theme-color-focus: #fd0;
	--theme-color-focus-text: #000;
	--theme-color-focus-outline: #000;
	--theme-color-underline: #B00594;
	--theme-color-link: #082a74;
	--theme-color-link-hover: #003078;
	--theme-color-decoration: #082a74;
	--theme-color-card-background: #f1f2f9;
    --theme-color-card-border: #f1f2f9;
	--theme-color-white: #fff;
}

/* Normalise */
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

main {
    display: block;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

img {
    border-style: none;
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

fieldset {
    padding: 0.35em 0.75em 0.625em;
}

legend {
    box-sizing: border-box;
    color: inherit;
    display: table;
    max-width: 100%;
    padding: 0;
    white-space: normal;
}

details {
    display: block;
}

@font-face {
    font-family: InterVariable;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/css/fonts/InterVariable.woff2") format("woff2");
}
@font-face {
    font-family: InterVariable;
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("/css/fonts/InterVariable-Italic.woff2") format("woff2");
}

@view-transition {
	navigation: auto;
}

* {
	box-sizing: border-box;
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd {
    margin: 0;
}

body {
    /* border-top: 5px solid var(--theme-color-primary); */
    background-color: var(--theme-color-background);
    color: var(--theme-color-text);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-family: var(--font-base);
    font-size: var(--size-step-0);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--theme-color-primary);
    line-height: var(--leading-fine);
    text-wrap: balance;
}

h1 {
    font-size: var(--size-step-4);
}

h2 {
    font-size: var(--size-step-4);
    max-width: 45ch;
}

h3 {
    font-size: var(--size-step-3);
    max-width: 45ch;
}

h1::after,
h2::after {
   background: none repeat scroll 0 0 var(--theme-color-underline);
   bottom: -10px;
   content: "";
   display: block;
   position: relative;
   transform: skew(-20deg);
   border-radius: 58% 33% 53% 0% / 100% 0% 100% 30% ;
}

h1::after {
    height: 6px;
    width: 40%;
}

@media (min-width: 48rem) {
    h1::after {
        height: 8px;
        width: 25%;
    }
}

h2::after {
    height: 6px;
    width: 40%;
}

@media (min-width: 48rem) {
    h2::after {
        height: 7px;
        width: 25%;
    }
}

dl dt {
    font-weight: bold;
    margin-bottom: 1rem;
}

dl dd {
    margin-bottom: 2rem;
}

.visually-hidden:not(:focus):not(:active) {
	border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

a {
    color: var(--theme-color-link);
    text-decoration: underline;
    text-decoration-color:var(--theme-color-decoration);
    text-decoration-thickness: max(2px, 0.0625rem);
    text-underline-offset: 0.1em;
}

a:hover {
    color: var(--theme-color-link-hover);
    text-decoration-thickness: max(3px, 0.1875rem, 0.12em);
}

a:focus {
    background-color: var(--theme-color-focus);
    border: 0;
    color: var(--theme-color-focus-text);
    outline: 3px solid var(--theme-color-focus-outline);
    outline-offset: 3px;
    text-decoration: none;
}

/* Fluid images via https://www.zachleat.com/web/fluid-images/ */
img{
	max-width: 100%;
}
img[width][height] {
	height: auto;
}
img[src$=".svg"] {
	width: 100%;
	height: auto;
	max-width: none;
}
video,
iframe {
	width: 100%;
	height: auto;
}
iframe {
	aspect-ratio: 16/9;
}

.prose {
    --flow-space: var(--space-l);
    line-height: var(--leading-loose);
    font-size: var(--size-step-1);
}

.prose :is(h1, h2, h3, h4) + *:not([class]) {
    --flow-space: var(--space-m);
}

.prose * + :is(h1, h2, h3, h4):not([class]) {
    --flow-space: var(--space-xl);
}

.prose blockquote {
    max-width: 60ch;
}

.prose :is(p, li, dl, figcaption) {
    max-width: 65ch;
}

blockquote {
    border-left: 5px solid var(--theme-color-underline);
    font-size: var(--size-step-1);
    font-style: italic;
    line-height: var(--leading-standard);
    padding: 1.25rem;
    position: relative;
}

.flow > * + * {
    margin-top: var(--flow-space, 1em);
}

.meta {
    font-size: var(--size-step-0);
    margin: 0;
}

ul, ol {
    padding-inline-start: 1.5ch;
    list-style-type: disc;
}

ul:not([class]) > li {
    padding-inline-start: var(--space-2xs);
}

ul ::marker {
    color: var(--theme-color-primary);
    font-size: 1.2em;
}

ol ::marker {
    color: var(--theme-color-primary);
}

:is(ol, ul) {
    margin-block-end: 0;
}

::selection {
    color: #fff;
    background-color: var(--theme-color-primary);
}

.title {
    margin-bottom: var(--space-s);
    line-height: var(--leading-standard);
}

.title::after {
    content: none;
}

.details {
    margin-bottom: var(--space-xs);
}

code, kbd {
    display: inline-block;
    background-color: var(--theme-color-background-code);
    border: 1px solid var(--theme-color-primary);
    border-radius: 4px;
    padding: 0.2em 0.2em 0.05em 0.2em;
    line-height: var(--leading-compact);
}

kbd {
    box-shadow: inset 0 -2px 0 var(--theme-color-primary);
    font-size: .9em;
    text-align: center;
    padding: 2px 5px;
}

figcaption {
    font-size: var(--size-step-0);
    margin: 0;
    padding: 0 0.75em 0 1em;
    position: relative;
}

figcaption::before {
    border-radius: 0% 100% 0% 100% / 100% 100% 100% 100%;
    background: none repeat scroll 0 0 var(--theme-color-primary);
    left: 0;
    content: "";
    display: inline-block;
    position: absolute;
    width: 3px;
    height: 100%;
}

.flex-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-l);
}

@media (min-width: 48rem) {
    .flex-container {
        flex-direction: row;
    }
}

.flex-container__block {
    flex: 1;
}

.boxed {
    background: var(--theme-color-card-background);
    border: 1px solid var(--theme-color-card-border);
    padding: 20px;
    border-radius: 8px;
}

.container {
    margin: 0 auto;
    max-width: 62.5rem;
    padding: 0 1rem;
}

@media (min-width: 68rem) {
    .container {
        display: flex;
        justify-content: space-between;
        padding: 0;
    }
}

.skip-link {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    font-size: 1rem;
    line-height: 1.5;
    display: block;
    padding: 10px 15px;
}

.skip-link:focus {
    background-color: var(--theme-color-focus);
    color: var(--theme-color-focus-text);
    outline: 3px solid var(--theme-color-skip-link-focus-outline);
    outline-offset: -5px;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: inherit !important;
    overflow: visible !important;
    clip: auto !important;
    -webkit-clip-path: none !important;
    clip-path: none !important;
    white-space: inherit !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.1em;
}

h1 {
    color: var(--theme-color-primary);
    font-size: var(--size-step-4);
    margin: 0 0 .67em 0;
}

@media (min-width: 48rem) {
    h1 {
        font-size: var(--size-step-7);
    }
}

.under-construction {
    background-color: var(--theme-color-background-alt);
    color: var(--theme-color-text-alt);
    line-height: var(--leading-loose);
}

.logo-link {
    color: var(--theme-color-text);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo {
    display: block;
    font-weight: bold;
    font-size: 1.35rem;
}

.logo-image-container {
	display: inline-block;
	vertical-align: top;
	position: relative;
    width: 50px;
    height: 50px;
}

.logo-image {
    border-radius: 43% 57% 47% 53% / 49% 43% 57% 51%;
    width: 50px;
    height: 50px;
}

.logo-image-container img.logo-image {
	bottom: 0;
    height: 100%;
    left: 0;
    margin: 0;
    max-width: none;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    object-fit: cover;
}

.tagline {
    display: block;
    margin-top: 3px;
}

.main-nav {
    display: flex;
    font-family: "code_pro_regular", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    margin-top: 2rem;
}

@media (min-width: 48rem) {
    .main-nav {
        margin-top: 0;
        margin-left: 3rem;;
    }
}
.under-construction__content {
    padding: 1rem;
}

@media (min-width: 48rem) {
    .under-construction__content {
        margin: 0 auto;
        max-width: 62.5rem;
    }
}

.header__content {
    padding: 1rem;
}

@media (min-width: 48rem) {
    .header__content {
        align-items: center;
        display: flex;
        justify-content: space-between;
        margin: 0 auto;
        max-width: 62.5rem;
    }
}

@media (min-width: 68rem) {
    .header__content {
        padding: 1rem 0;
    }
}

.main-nav__links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--gutter, var(--space-s-m));
    justify-content:center;
    list-style: none;
    margin-top: 0;
    padding-left: 0;
}

@media (min-width: 48rem) {
    .main-nav__item {
        padding-right: 2rem;
        margin-bottom: 0;
    }
}

.main-nav__item:last-child {
    padding-right: 0;
}

.main-nav__link {
    color: var(--theme-color-link);
    display: inline-block;
    font-size: var(--size-step-1);
    text-decoration: underline;
    text-decoration-color:var(--theme-color-decoration);
    text-decoration-thickness: 2px;
    padding-block: 0.5em;
    min-height: 44px;
}

.main-nav__link:hover {
    text-decoration-thickness: 4px;
}

@media (min-width: 48rem) {
    .main-nav__link{
        font-size: 1.4rem;
    }
}

.main-nav__link.active {
    font-weight: bold;
}

.main {
    padding: 0;
    width: 100%;
}

@media (min-width: 48rem) {
    .main {
        margin: 2rem 0;
        padding: 1rem 0;
    }
}

footer.post-footer {
    border-top: 2px solid var(--theme-color-underline);
    margin-top: 6rem;
    padding-top: 2rem;
}

.post-footer__heading {
    font-size: var(--size-step-3);
    max-width: 45ch;
}

.post-footer__heading::after {
    content: none;
}

.footer {
    padding-bottom: var(--space-l);
    padding-top: var(--space-l);
}

@media (min-width: 68rem) {
    .footer {
        display: block;
    }
}

.footer__link {
    display: block;
    min-height: 44px;
    padding-block: 0.5em;
}

@media (min-width: 48rem) {
    .footer__link {
        display: inline-block;
        padding-right: var(--space-s);
    }
}

.table-wrapper {
    display: block;
    overflow-x: auto;
    width: 100%;

    background: linear-gradient(to right, var(--theme-color-white) 30%, rgb(255 255 255 / 0%)), linear-gradient(to right, rgb(255 255 255 / 0%), var(--theme-color-white) 70%) 0 100%, radial-gradient(farthest-side at 0% 50%, rgb(0 0 0 / 20%), rgb(0 0 0 / 0%)), radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 20%), rgb(0 0 0 / 0%)) 0 100%;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100%, 0 0, 100%;
    background-attachment: local, local, scroll, scroll;
}

.table-wrapper:focus {
    outline: 2px solid var(--theme-color-focus-outline);
}

table {
    border: 1px solid var(--theme-color-primary);
    border-collapse: collapse;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: left;
    max-width: 100%;
    width: 100%;
}

table thead {
    background-color: var(--theme-color-background);
}

th:not(:only-of-type) {
    border-block-end: 1px solid var(--theme-color-primary);
}

:is(th, td) ~ :is(th, td) {
    border-inline-start: 1px solid var(--theme-color-primary);
}

tr + tr :is(th, td) {
    border-block-start: 1px solid var(--theme-color-primary);
}

td, th {
    padding: var(--space-xs) var(--space-s);
}

td ul {
    margin: 0;
}

table tbody td {
    vertical-align: top;
}

table caption {
    text-align: left;
    margin-bottom: var(--space-s);
}

pre > code {
    border: 0;
}

.callout {
    border: .75rem solid var(--theme-color-primary);
    padding: var(--space-s-m);
}

h2.callout__heading {
    font-size: var(--size-step-3);
}

h2.callout__heading::after {
    content: none;
}

.callout p {
    margin-top: var(--flow-space, 1em);
}

.links-nextprev {
	display: flex;
	justify-content: space-between;
	gap: .5em 1em;
	list-style: "";
	border-top: 1px dashed var(--color-gray-20);
	padding: 1em 0;
}
.links-nextprev > * {
	flex-grow: 1;
}
.links-nextprev-next {
	text-align: right;
}

/* Posts list */
.post-list {
	list-style: none;
	padding: 0;
}
.post-list__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	counter-increment: start-from -1;
	margin-bottom: 1em;
}

/* Tags */
.post-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-transform: capitalize;
	font-style: italic;
}
.post-list__item > .post-tag {
	align-self: center;
}

/* Tags list */
.post-metadata {
	display: inline-flex;
	flex-wrap: wrap;
	gap: .5em;
	list-style: none;
	padding: 0;
	margin: 0;
}
.post-metadata time {
	margin-right: 1em;
}

.mobile-image-wrapper {
    background: #fff;
    border: 5px solid var(--theme-color-primary);
    border-radius: 10px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    margin-left: auto;
    margin-right: auto;
    max-width: 320px;
    overflow: hidden;
}

@media (min-width: 48rem) {
    .mobile-image-wrapper {
        margin-left: 0;
        margin-right: 0;
    }
}

.mobile-image-wrapper img {
    display: block;
}

@media (min-width: 48rem) {
    .theme-options {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
}

.theme-toggle-button {
    appearance: none;
    border: 2px solid var(--theme-color-primary);
    border-radius: 0;
    /* padding: 0.75em 1em; */
    margin-left: var(--space-xs);
    padding: var(--space-s) var(--space-s);
    font-size: 0.875em;
    font-weight: bold;
    color: var(--theme-color-primary);
    background-color: var(--theme-color-background);
    cursor: pointer;
}

.theme-toggle-button:not([aria-pressed=false]) {
    background-color: var(--theme-color-primary);
    color: var(--theme-color-background);
}

.theme-toggle-button:focus {
    background-color: var(--theme-color-focus);
    color: var(--theme-color-focus-text);
    outline: 3px solid var(--theme-color-focus-outline);
    outline-offset: 2px;
}

@media print {
  .under-construction,
  .logo-image-container,
  .main-nav,
  .footer {
    display: none;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  h1, h2, h3, h4, h5, h6 {
    color: black;
  }

  h1 {
    font-size: 24pt;
  }

  h2 {
    font-size: 20pt;
  }

  h3 {
    font-size: 18pt;
  }

  h4 {
    font-size: 16pt;
  }

  h5 {
    font-size: 14pt;
  }

  h6 {
    font-size: 12pt;
  }
}