/* || Fonts. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 500;
  font-style: normal;

  font-display: optional;
  src: url("/fonts/atkinson-hyperlegible-next/medium.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 500;
  font-style: italic;

  font-display: optional;
  src: url("/fonts/atkinson-hyperlegible-next/medium-italic.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 800;
  font-style: normal;

  font-display: optional;
  src: url("/fonts/atkinson-hyperlegible-next/extra-bold.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-weight: 800;
  font-style: italic;

  font-display: optional;
  src: url("/fonts/atkinson-hyperlegible-next/extra-bold-italic.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Baskerville";
  font-weight: 500;
  font-style: normal;

  font-display: optional;
  src: url("/fonts/libre-baskerville/medium.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Baskerville";
  font-weight: 500;
  font-style: italic;

  font-display: optional;
  src: url("/fonts/libre-baskerville/medium-italic.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Baskerville";
  font-weight: 700;
  font-style: normal;

  font-display: optional;
  src: url("/fonts/libre-baskerville/bold.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Baskerville";
  font-weight: 700;
  font-style: italic;

  font-display: optional;
  src: url("/fonts/libre-baskerville/bold-italic.dist.woff2") format("woff2");
}

@font-face {
  font-family: "Go Mono";
  font-weight: 600;
  font-style: normal;

  font-display: optional;
  src: url("/fonts/go-mono/bold.dist.woff2") format("woff2");
}

/* || Variables. */

:root {
  --color-bg: oklab(93.1% 0 0);
  --color-fg: oklab(30.1% 0 0);
  --color-primary-colorful: var(--color-fg);
  --color-primary-colorless: var(--color-bg);
  --font-sans-serif: "Atkinson Hyperlegible Next", sans-serif;
  --font-serif: "Libre Baskerville", serif;
  --font-weight-regular: 500;
  --font-weight-bold: 800;
  --font-mono: "Go Mono", monospace;
  --font-mono-weight: 600;
  --text-underline: solid underline 10%;
  --root-font-size: 18px;
  --paragraph-line-width: 38rem;
  --paragraph-line-height: 2rem;
  --paragraph-font-size: 1rem;
  --paragraph-gap: calc(var(--paragraph-line-height) * .7);
}

/* || CSS reset. */

/* Taken from: <https://www.joshwcomeau.com/css/custom-css-reset/>. */

*,
  *::before,
  *::after {
    box-sizing: border-box;
  }

*:not(dialog) {
  margin: 0;
}

/* Enable keyword animations. */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  font-size: var(--root-font-size);

  -webkit-font-smoothing: antialiased;
}

/* Improve media defaults. */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for form controls. */
input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

p {
  font-size: var(--paragraph-font-size);
  line-height: var(--paragraph-line-height);
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}


/* || Website styles. */

html,
body {
  font-size: 18px;
  font-weight: var(--font-weight-regular);
  color: var(--color-fg);
  background-color: var(--color-bg);
}

nav {
  font-size: 1.2rem;
}

a,
a:active,
a:visited {
  color: var(--color-primary-fg);
  text-decoration: var(--text-underline);
}

.site-title,
nav,
footer {
  padding: 8px;

  font-family: var(--font-sans-serif);
  color: var(--color-primary-colorless);
  text-align: center;

  background-color: var(--color-primary-colorful);

  a,
  a:active,
  a:visited {
    color: var(--color-primary-colorless);
  }
}

.site-title {
  margin-bottom: 2px;
  font-size: 2rem;
}

#content-container {
  min-height: 100dvh;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-weight: var(--font-mono-weight);
  font-synthesis: none;
}


main {
  /* Create a root stacking context. */
  isolation: isolate;
  max-width: var(--paragraph-line-width);
  margin: auto;
  padding: 32px;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 1.2rem;
    margin-bottom: 1rem;
    font-family: var(--font-sans-serif);
    font-weight: var(--font-weight-bold);
  }

  h1,
  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.8rem;
  }

  h4 {
    font-size: 1.4rem;
  }

  h5,
  h6 {
    font-size: 1.2rem;
  }

  p,
  span {
    font-family: var(--font-serif);

    &:has(+p) {
	margin-bottom: var(--paragraph-gap);
    }
  }

  .feed {
    h2 {
	margin-bottom: 0;

	& + span {
	  display: block;
	  margin-bottom: 1.2rem;
	  font-family: var(--font-sans-serif);
	  font-weight: var(--font-weight-bold);
	}
    }
  }

}
