@font-face {
  font-family: "Google Sans Flex";
  font-style: normal;
  font-weight: 400 650;
  font-display: swap;
  src: url("fonts/google-sans-flex-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Petrona";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/petrona-latin-500.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --canvas: #fafafa;
  --text: #242528;
  --body-text: #56585e;
  --secondary: #66686d;
  --dots: #c9cbd0;
  --line: #e1e2e5;
  --selection: #dce6f2;
  font-family: "Google Sans Flex", system-ui, sans-serif;
  font-synthesis: none;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #111213;
    --text: #efeff1;
    --body-text: #b6b8be;
    --secondary: #a7a9af;
    --dots: #37393e;
    --line: #303237;
    --selection: #344253;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  position: relative;
  isolation: isolate;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

/* The editor's 16px dot grid stays quiet around the reading column. */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(var(--dots) 0.7px, transparent 0.9px);
  background-position: 8px 8px;
  background-size: 16px 16px;
  mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 calc(50% - 28rem),
    transparent calc(50% - 18rem),
    transparent calc(50% + 18rem),
    #000 calc(50% + 28rem),
    #000 100%
  );
  pointer-events: none;
  content: "";
}

::selection {
  color: var(--text);
  background: var(--selection);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:hover {
  color: var(--text);
  text-decoration-line: underline;
}

a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--text);
  outline-offset: 5px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  padding: 0.5rem 0.75rem;
  transform: translateY(-200%);
  background: var(--canvas);
}

.skip-link:focus {
  transform: none;
}

.page {
  width: min(100% - 3rem, 52.5rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6rem;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.325rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  background: currentColor;
  -webkit-mask: url("logo.svg") center / contain no-repeat;
  mask: url("logo.svg") center / contain no-repeat;
}

.brand-name {
  /* Center Petrona's visible letters, which sit high inside its line box. */
  transform: translateY(calc(0.16em - 1px));
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  min-height: 2.75rem;
  padding-inline: 0.375rem;
  margin-right: -0.375rem;
  font-size: 0.9375rem;
}

.github-link,
.github-link:hover {
  text-decoration: none;
}

.github-mark {
  display: block;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
  shape-rendering: geometricPrecision;
}

main {
  width: min(100%, 38.75rem);
  margin-inline: auto;
  padding-top: 4.75rem;
}

main:focus {
  outline: none;
}

h1,
h2,
.brand {
  font-family: "Petrona", Georgia, serif;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12em;
  font-size: clamp(2.25rem, 4.7vw, 3.125rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--body-text);
  font-size: 1.125rem;
  line-height: 1.65;
  letter-spacing: -0.015em;
}

.details {
  display: grid;
  gap: 2.5rem;
  margin-top: 4.5rem;
}

h2 {
  margin-bottom: 0.625rem;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.details p {
  max-width: 36rem;
  color: var(--body-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.details p + p {
  margin-top: 0.875rem;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 38.75rem);
  margin: 4rem auto 1rem;
  padding-block: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  gap: 0.5rem;
  color: var(--secondary);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.copyright {
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 47.999rem) {
  body::before {
    opacity: 0.5;
    mask-image: linear-gradient(90deg, #000, transparent 15%, transparent 85%, #000);
  }

  .site-header {
    min-height: 5rem;
  }

  main {
    padding-top: 3rem;
  }

  .lead {
    font-size: 1.0625rem;
  }

  .details {
    gap: 2rem;
    margin-top: 3rem;
  }

  .site-footer {
    margin-top: 3rem;
  }
}

@media (prefers-contrast: more) {
  :root {
    --body-text: var(--text);
    --secondary: var(--text);
    --line: var(--text);
  }

  body::before {
    display: none;
  }
}

@media print {
  body::before,
  .skip-link {
    display: none;
  }

  .page {
    width: 100%;
  }

  main {
    padding-top: 2rem;
  }
}
