@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fira Code";
  src: url("../fonts/fira-code.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #fff;
  --text: #111;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "FiraCode Nerd Font", "Fira Code", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0a0a0a;
    --text: #fafafa;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 1.25rem/1.5 var(--font-sans);
}
main {
  width: min(100% - 3rem, 22rem);
  min-height: 100svh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 8svh, 6rem);
}
h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
}
h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}
main > h1 + ul { margin-top: 1.5rem; }
main > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
main > ul > li {
  font-family: var(--font-mono);
}
main > ul > li:not(:has(> a)) {
  padding-block: 0.5rem;
}
main[data-rainbow-links] > ul > li > a {
  display: block;
  padding-block: 0.5rem;
  padding-inline-end: 2rem;
}
a {
  color: inherit;
  font-family: var(--font-mono);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.35em;
}
img { max-width: 100%; height: auto; }
.document {
  width: min(100% - 3rem, 60rem);
  justify-content: flex-start;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.technical-notes, .blog { width: min(100%, 38rem); margin-inline: auto; }
.notes-back {
  margin-bottom: 2rem;
  padding-block: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.65;
}
.notes-back:is(:hover, :focus-visible) { opacity: 1; }
.notes-content > ul { margin: 2rem 0 0; padding: 0; list-style: none; }
.notes-content > h2 + ul { margin-top: 0; }
.notes-content > ul > li > a { display: block; padding: 0.75rem 2rem 0.75rem 0; }
.blog-list { margin: 2rem 0 0; padding: 0; list-style: none; }
.blog-list li + li { margin-top: 1.5rem; }
.blog-list a { display: block; padding: 0.5rem 2rem 0.5rem 0; }
.blog-list time, .blog-date {
  display: block;
  font: 400 0.8125rem/1.5 var(--font-mono);
  opacity: 0.65;
}
.blog-date { margin-top: 0.75rem; }
.blog-empty { margin-top: 2rem; opacity: 0.65; }
.blog-content { margin-top: 2.5rem; }
.blog-content h2 { scroll-margin-top: 3rem; }
.blog-content a { text-decoration-color: currentColor; }
.blog-content pre { padding: 1rem; overflow-x: auto; font-size: 0.875rem; }
.blog-content :not(pre) > code { overflow-wrap: anywhere; }
.resume { min-width: 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .reveal-ready .resume > :not(.is-revealed) { visibility: hidden; }
}
.resume > :first-child { margin-top: 0; }
.resume h1 { margin-top: 2.5rem; font-size: 1.5rem; }
.resume h1 + p { margin-top: 0.5rem; opacity: 0.65; }
.resume h2 {
  margin: 4rem 0 1.5rem;
  scroll-margin-top: 3rem;
}
.resume h2 ~ h2 { margin-top: 6rem; }
.resume h3 {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  font: 400 1.125rem/1.6 var(--font-mono);
  text-wrap: balance;
}
.resume h2 + h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.resume p { margin: 0.75rem 0; }
.resume ul {
  margin: 0.75rem 0 0;
  padding-inline-start: 1.125rem;
}
.resume li { padding-inline-start: 0.375rem; }
.resume li + li { margin-top: 1rem; }
.resume ul.metadata {
  margin: 0.75rem 0 1.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.8;
  opacity: 0.65;
}
.resume .metadata > li {
  display: inline;
  margin: 0;
  padding: 0;
}
.resume .metadata > li + li::before {
  content: "*";
  display: inline-block;
  margin-inline: 0.625em;
  font-family: var(--font-mono);
  line-height: 1;
  vertical-align: baseline;
}
.resume a {
  font-family: inherit;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}
.resume .resume-back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  margin-inline-start: -0.75rem;
  font: 400 0.875rem/1.5 var(--font-mono);
  opacity: 0.65;
  text-decoration-color: transparent;
}
.resume .resume-back:is(:hover, :focus-visible) {
  opacity: 1;
  text-decoration-color: currentColor;
}
.resume-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.5rem;
  font: 400 0.8125rem/1.5 var(--font-mono);
}
.resume-sections a { padding-block: 0.5rem; }
@media (min-width: 60rem) {
  .resume {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    column-gap: 3rem;
  }
  .resume > * { grid-column: 2; }
  .resume h2 {
    grid-column: 1;
    margin: 4rem 0 0;
    padding-top: 0.375rem;
  }
  .resume h2 + h3,
  .resume h2 + ul { margin-top: 4rem; }
  .resume h2 ~ h2 + h3,
  .resume h2 ~ h2 + ul { margin-top: 6rem; }
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

main > .social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 3rem 0 0;
}
main > .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  opacity: 0.65;
}
.social-links img {
  width: 1.25rem;
  height: 1.25rem;
}
.social-links a:is(:hover, :focus-visible) { opacity: 1; }
.social-links a::before, .social-links a::after { display: none; }
@media (prefers-color-scheme: dark) {
  .social-links img { filter: invert(1); }
}

[data-rainbow-links] a {
  position: relative;
  display: inline-block;
  text-decoration: none;
}
.resume :is(p, li) a:not(:is(h1, h2, h3, h4, h5, h6) a),
.blog-content a:not(:is(h1, h2, h3, h4, h5, h6) a) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 0.25em;
}
.resume :is(p, li) a[data-external]:not(:is(h1, h2, h3, h4, h5, h6) a)::after,
.blog-content a[data-external]:not(:is(h1, h2, h3, h4, h5, h6) a)::after {
  display: none;
}
[data-rainbow-links] a::before {
  content: "";
  position: absolute;
  pointer-events: none;
  bottom: 0;
  height: 2px;
  left: var(--bar-left, 0);
  width: var(--bar-width, 100%);
  /* Full HSV saturation and value correspond to HSL 100% saturation, 50% lightness. */
  background: hsl(var(--link-hue, 0) 100% 50%);
  transform: scaleX(0);
  transform-origin: left;
}
.resume-sections a::before {
  left: 0;
  width: 100%;
}
[data-rainbow-links] a[data-external]::after {
  content: "";
  position: absolute;
  pointer-events: none;
  left: calc(var(--bar-left, 0px) + var(--bar-width, 100%) - 1.5rem);
  top: calc(50% - 0.5rem);
  width: 1rem;
  height: 1rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 17 17 7M7 7h10v10' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
}
[data-rainbow-links] a:is(:hover, :focus-visible)::before { transform: scaleX(1); }
[data-rainbow-links] a:is(:hover, :focus-visible)::after { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  [data-rainbow-links] a::before { transition: transform 0.3s ease-out; }
  [data-rainbow-links] a::after { transition: opacity 0.15s 0.15s; }
}
