/* Albert Sans (SIL OFL 1.1, see assets/fonts/OFL.txt), self-hosted */
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/albert-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/albert-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Albert Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/albert-sans-latin-wght-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/albert-sans-latin-ext-wght-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --page: #fafaf8;
  --ink: #1c1c1b;
  --muted: #686866;
  --accent: #0969da;
  --rule: #e5e5e1;
  --wash: #f0f0ed;
  --sans: "Albert Sans", "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 42rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #161615;
  --ink: #ececea;
  --muted: #9b9b98;
  --accent: #4493f8;
  --rule: #2d2d2b;
  --wash: #21211f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #161615;
    --ink: #ececea;
    --muted: #9b9b98;
    --accent: #4493f8;
    --rule: #2d2d2b;
    --wash: #21211f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent); }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; }
img { max-width: 100%; height: auto; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

button, input, select { font: inherit; color: inherit; }
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
code, pre { font-family: var(--mono); }

.skip-link {
  position: fixed;
  inset: .5rem auto auto var(--gutter);
  z-index: 5;
  background: var(--page);
  padding: .5rem .75rem;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-inline: var(--gutter); margin-inline: auto; }

/* Navigation: stays at the top while scrolling */
html { scroll-padding-top: 5rem; }
.site-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--page) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-nav.is-stuck { border-bottom-color: var(--rule); }
.nav-inner {
  display: flex;
  align-items: center;
  gap: .5rem 1.5rem;
  min-height: 4rem;
  font-size: .9375rem;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-inline-end: auto;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-brand img { width: 1.75rem; height: 1.75rem; flex: none; }
.nav-links { display: flex; gap: 0 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav-inner a:not(.nav-brand) {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
}
.nav-inner a:hover { color: var(--accent); }
.nav-inner a:not(.nav-brand):hover { text-decoration: underline; text-underline-offset: .35em; text-decoration-thickness: 1px; }
.nav-toggle { display: none; }

@media (max-width: 36rem) {
  html { scroll-padding-top: 4.25rem; }
  .nav-inner { min-height: 3.5rem; gap: 0 1rem; }
  .nav-brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-links { gap: 0 1.1rem; }
  .nav-links li:first-child { display: none; } /* the cup already returns to the top */
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.theme-control { display: inline-flex; }
.theme-control select {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--muted);
  cursor: pointer;
}
.theme-control select:hover { color: var(--accent); }
.theme-control select:focus,
.theme-control select:focus-visible { outline: none; box-shadow: none; }
.theme-control select:focus-visible { color: var(--accent); }

/* Footer */
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding-block: 3rem 4rem;
  color: var(--muted);
  font-size: .875rem;
}
.footer-inner p a, .footer-links a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.25rem; }
.footer-inner > a, .footer-links a, .theme-control { min-height: 2.75rem; display: inline-flex; align-items: center; }
@media (max-width: 36rem) {
  /* 16px stops iOS zooming in when the theme menu is tapped */
  .footer-inner { font-size: 1rem; padding-block: 2rem 3rem; }
}

/* Smooth page-to-page transitions (cross-document view transitions) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }

  /* A simple crossfade between pages */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
}

@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme]) {
    color-scheme: light;
    --page: #fff;
    --ink: #000;
    --muted: #333;
    --accent: #000;
    --rule: #aaa;
  }
  .site-nav, .site-footer, .skip-link { display: none !important; }
  body { font-size: 11pt; }
}
