:root {
  color-scheme: light;
  --background: #fff;
  --ink: #111;
  --muted: #666;
  --rule: #bdbdbd;
  --shade: #eee;
  --code-panel: #f7f7f7;
  --link: #5a35a5;
  --link-hover: #381d72;
  --action: #6a3fc0;
  --action-hover: #533095;
  --footer: #ccc;
  --page-width: 800px;
  --text-width: 800px;
  --sans: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Courier, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111;
  --ink: #f1f1f1;
  --muted: #aaa;
  --rule: #555;
  --shade: #242424;
  --code-panel: #181818;
  --link: #c2a7ff;
  --link-hover: #e0d2ff;
  --action: #8258d0;
  --action-hover: #9871df;
  --footer: #777;
}

* {
  box-sizing: border-box;
}

strong,
b {
  font-weight: 600;
}

html {
  color: var(--ink);
  background: var(--background);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: 100%;
  font-stretch: 95%;
  font-weight: 450;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  padding: 0.5rem;
  background: var(--background);
  border: 1px solid var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  width: 100%;
  max-width: var(--page-width);
  margin-left: 0;
}

.site-header {
  border-bottom: 1px solid var(--ink);
}

.header-inner {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) auto;
  column-gap: 0.8rem;
  max-width: none;
  padding: 0 0.4rem 0.5em;
  line-height: 1.2;
}

.site-nav a[aria-current="page"] {
  font-weight: inherit;
}

.theme-toggle {
  align-self: start;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  margin: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  border: 0;
  background: transparent;
  font: inherit;
}

.theme-toggle:hover {
  color: var(--ink);
  text-decoration: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.theme-toggle__icon {
  display: inline-grid;
  width: 0.88rem;
  height: 0.88rem;
  place-items: center;
  opacity: 0.38;
  transition: opacity 160ms ease, transform 160ms ease;
}

.theme-toggle__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-toggle__track {
  position: relative;
  width: 2.05rem;
  height: 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--shade);
  transition: background-color 160ms ease;
}

.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 0.16rem;
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
  background: var(--ink);
  transform: translateY(-50%);
  transition: transform 180ms ease;
}

.theme-toggle__icon--sun {
  opacity: 1;
}

.theme-toggle:hover .theme-toggle__track {
  background: var(--code-panel);
}

.theme-toggle:hover .theme-toggle__icon--sun,
:root[data-theme="dark"] .theme-toggle:hover .theme-toggle__icon--moon {
  transform: scale(1.08);
}

:root[data-theme="dark"] .theme-toggle__thumb {
  transform: translate(1.05rem, -50%);
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0.38;
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle__icon,
  .theme-toggle__track,
  .theme-toggle__thumb {
    transition: none;
  }
}

main {
  margin-top: 6rem !important;
  padding-right: 0.4rem;
  padding-left: 0.4rem;
}

section {
  margin-bottom: 2rem;
}

h1,
h2,
h3,
h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

h1,
h2 {
  margin: 0 0 0.65rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.section-title h1,
.section-title h2 {
  display: inline-block;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(18.5em, 1fr);
  gap: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  border: 0.1rem solid var(--rule);
}

th,
td {
  padding: 0.3rem 0.6rem 0;
  vertical-align: top;
}

th {
  border-bottom: 0.1rem solid var(--ink);
  background: var(--shade);
  font-weight: 600;
}

td {
  border-bottom: 0.1rem solid var(--rule);
}

td:first-child,
th:first-child {
  width: 12rem;
}

td:last-child,
th:last-child {
  width: 7rem;
}

.notes-table--archive td:last-child,
.notes-table--archive th:last-child {
  width: auto;
}

.personal-table td:first-child,
.personal-table th:first-child {
  width: 12rem;
}

.about-grid thead th:first-child {
  white-space: nowrap;
}

.about-grid td:last-child,
.about-grid th:last-child {
  width: auto;
}

.contact-table td:first-child,
.contact-table th:first-child {
  width: 5.5rem;
}

.about-grid > .contact-table {
  overflow: visible;
}

.contact-table table {
  width: 100%;
}

.contact-table td:last-child {
  white-space: nowrap;
}

.contact-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-label--stacked {
  display: inline;
}

.contact-row--stacked td:last-child {
  vertical-align: bottom;
}

.contact-icon {
  width: 0.875em;
  height: 0.875em;
  flex: 0 0 auto;
}

:root[data-theme="dark"] .contact-icon {
  filter: invert(1);
}

.markdown-cell p {
  margin: 0 0 0.7rem;
}

.markdown-cell p:last-child {
  margin-bottom: 0;
}

.site-footer {
  margin-top: 4rem;
  padding-right: 0.4rem;
  padding-left: 0.4rem;
  color: var(--footer);
}

.site-footer small {
  font-size: 80%;
  font-weight: 400;
}

.read-button {
  position: relative;
  top: -2px;
  display: inline-block;
  width: 6em;
  max-width: 6em;
  height: 1.4rem;
  padding: 0.15rem 0.3rem;
  border: 0.1rem solid var(--action-hover);
  border-radius: 0.1rem;
  background: var(--action);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.2rem;
  text-align: center;
  white-space: nowrap;
}

.read-button:hover,
.read-button:focus {
  border-color: var(--action-hover);
  background: var(--action-hover);
  color: #fff;
  text-decoration: none;
}

.archive {
  max-width: var(--text-width);
  margin-top: 4rem !important;
}

.article-shell {
  max-width: 48em;
  margin-top: 4rem !important;
}

.article-header {
  padding: 0;
}

.article-header h1 {
  margin: 0 0 0.5em;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.article-published {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.prose {
  margin: 0;
}

.prose h2,
.prose h3 {
  margin: 0 0 0.5em;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.prose h3 {
  font-style: italic;
}

.prose p,
.prose blockquote {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.prose ul,
.prose ol {
  margin: 0.8rem 0 0.8rem 1.6rem;
  padding: 0;
}

.prose li {
  margin-top: 0.4rem;
}

.prose a {
  text-decoration: underline;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

.prose code {
  padding: 0.1rem 0.2rem;
  border-radius: 0.1rem;
  background: var(--shade);
  font-family: var(--mono);
  font-size: 90%;
  line-height: 1.25;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--code-panel);
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.back-button {
  position: relative;
  top: -2px;
  display: inline-block;
  height: 1.8rem;
  padding: 0.3rem 0.4rem 0.1rem;
  border: 0.1rem solid var(--action-hover);
  border-radius: 0.1rem;
  background: var(--action);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.2rem;
  text-align: center;
  white-space: nowrap;
}

.back-button:hover,
.back-button:focus {
  border-color: var(--action-hover);
  background: var(--action-hover);
  color: #fff;
  text-decoration: none;
}

/* Resume — an editorial document on screen, a compact CV on paper. */
.resume-shell {
  width: min(100%, 72rem);
  margin-top: 2.5rem !important;
  padding: 0 0.4rem;
}

.resume-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.resume-print {
  padding: 0.35rem 0.65rem 0.25rem;
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--background);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
}

.resume-print:hover {
  background: var(--background);
  color: var(--ink);
}

.resume-print:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.resume-document {
  --resume-accent: #5a35a5;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--background);
}

:root[data-theme="dark"] .resume-document {
  --resume-accent: #c2a7ff;
}

.resume-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.75fr);
  gap: 2.5rem;
  align-items: end;
  padding: 2.2rem 2.4rem 1.8rem;
  border-bottom: 0.45rem solid var(--resume-accent);
}

.resume-kicker {
  margin: 0 0 0.3rem;
  color: var(--resume-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.resume-masthead h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-stretch: 85%;
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.resume-headline {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.resume-masthead address {
  font-style: normal;
}

.resume-contact,
.resume-facts,
.resume-course-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resume-contact li,
.resume-facts li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.18rem 0;
}

.resume-contact li > span,
.resume-facts li > span {
  color: var(--muted);
}

.resume-contact a,
.resume-facts a,
.resume-entry h3 a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-decoration-line: underline;
  text-underline-offset: 0.16em;
}

.resume-contact li > :last-child {
  overflow-wrap: anywhere;
}

.resume-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 0.72fr) minmax(0, 2fr);
}

.resume-sidebar,
.resume-main {
  padding: 2rem 2.4rem 2.3rem;
}

.resume-sidebar {
  border-right: 1px solid var(--rule);
  background: var(--code-panel);
}

.resume-sidebar section,
.resume-main section {
  margin-bottom: 2rem;
}

.resume-sidebar section:last-child,
.resume-main section:last-child {
  margin-bottom: 0;
}

.resume-document h2 {
  margin: 0 0 0.9rem;
  padding-bottom: 0.38rem;
  border-bottom: 1px solid var(--ink);
  color: var(--resume-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.resume-facts li {
  grid-template-columns: 4rem minmax(0, 1fr);
}

.resume-course-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.25;
}

.resume-course-list li:last-child {
  border-bottom: 0;
}

.resume-course-list small {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.resume-skill-group {
  margin: 0 0 0.75rem;
}

.resume-skill-group:last-child {
  margin-bottom: 0;
}

.resume-skill-group h3 {
  margin: 0 0 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.resume-skill-group p {
  margin: 0;
  line-height: 1.35;
}

.resume-entry {
  break-inside: avoid;
  margin: 0 0 1.25rem;
}

.resume-entry:last-child {
  margin-bottom: 0;
}

.resume-entry__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
  align-items: baseline;
}

.resume-entry h3,
.resume-entry__role,
.resume-entry__meta,
.resume-entry__summary {
  margin: 0;
}

.resume-entry h3 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.resume-entry__role {
  justify-self: end;
  color: var(--resume-accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-align: right;
  text-transform: uppercase;
}

.resume-entry__meta {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.4rem;
  justify-content: space-between;
  margin-top: 0.05rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.resume-entry__summary {
  margin-top: 0.45rem;
  line-height: 1.4;
}

.resume-entry ul {
  margin: 0.4rem 0 0 1rem;
  padding: 0;
}

.resume-entry li {
  margin: 0.18rem 0;
  padding-left: 0.15rem;
  line-height: 1.4;
}

@media (max-width: 850px) {
  .header-inner {
    grid-template-columns: 7rem minmax(0, 1fr) auto;
    column-gap: 0.5rem;
  }

  main {
    margin-top: 3.5rem !important;
  }

  .about-grid {
    display: block;
  }

  .about-grid > :first-child {
    margin-bottom: 1rem;
  }

  .about-grid > .contact-table {
    overflow-x: auto;
  }

  .contact-table table {
    width: 100%;
  }

  td:first-child,
  th:first-child {
    width: 8rem;
  }

  .resume-masthead {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .resume-grid {
    grid-template-columns: 1fr;
  }

  .resume-sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .resume-sidebar section {
    margin-bottom: 0;
  }

}

@media (max-width: 30em) {
  body {
    padding: 1em 0.4em;
    font-size: 13px;
  }

  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .site-nav {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .personal-table {
    overflow-x: visible;
  }

  .personal-table table {
    table-layout: fixed;
  }

  .personal-table td {
    overflow-wrap: anywhere;
  }

  .personal-table td:first-child,
  .personal-table th:first-child {
    width: 10rem;
  }

  .resume-masthead,
  .resume-sidebar,
  .resume-main {
    padding: 1.4rem;
  }

  .resume-sidebar {
    display: block;
  }

  .resume-sidebar section {
    margin-bottom: 1.5rem;
  }

  .resume-entry__header {
    display: block;
  }

  .resume-entry__role {
    margin-top: 0.1rem;
    text-align: left;
  }

  .resume-entry__meta {
    margin-top: 0.15rem;
  }
}

@media (max-width: 600px) {
  .resume-sidebar {
    display: block;
  }

  .resume-sidebar section {
    margin-bottom: 1.5rem;
  }
}

@media print {
  @page {
    size: letter;
    margin: 0;
  }

  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --background: #fff;
    --ink: #111;
    --muted: #555;
    --rule: #aaa;
    --code-panel: #f4f4f4;
    --link: #111;
  }

  body {
    padding: 0;
    font-size: 9pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .site-header,
  .site-footer,
  .resume-toolbar {
    display: none;
  }

  main {
    margin-top: 0 !important;
  }

  .resume-shell {
    width: 100%;
    padding: 0.38in;
  }

  .resume-document {
    border: 0;
    --resume-accent: #3f3f3f;
  }

  .resume-masthead {
    grid-template-columns: minmax(0, 1fr) 3.45in;
    gap: 0.3in;
    padding: 0 0 0.15in;
    border-bottom-width: 0.05in;
  }

  .resume-masthead h1 {
    font-size: 37pt;
  }

  .resume-headline {
    margin-top: 0.07in;
    font-size: 9pt;
  }

  .resume-kicker,
  .resume-document h2 {
    font-size: 6.4pt;
  }

  .resume-contact li {
    grid-template-columns: 0.55in minmax(0, 1fr);
    gap: 0.08in;
    padding: 0.01in 0;
  }

  .resume-grid {
    grid-template-columns: 1.7in minmax(0, 1fr);
  }

  .resume-sidebar,
  .resume-main {
    padding: 0.17in 0.2in 0;
  }

  .resume-sidebar {
    display: block;
    padding-left: 0;
    border-right: 0.5pt solid var(--rule);
    border-bottom: 0;
  }

  .resume-main {
    padding-right: 0;
  }

  .resume-sidebar section,
  .resume-main section {
    margin-bottom: 0.14in;
  }

  .resume-document h2 {
    margin-bottom: 0.07in;
    padding-bottom: 0.03in;
  }

  .resume-course-list li {
    padding: 0.02in 0;
    line-height: 1.15;
  }

  .resume-course-list small,
  .resume-skill-group h3 {
    font-size: 6.2pt;
  }

  .resume-skill-group {
    margin-bottom: 0.06in;
  }

  .resume-entry {
    margin-bottom: 0.09in;
  }

  .resume-entry h3 {
    font-size: 8.2pt;
  }

  .resume-entry__role,
  .resume-entry__meta {
    font-size: 6.7pt;
  }

  .resume-entry__summary {
    margin-top: 0.025in;
    line-height: 1.22;
  }

  .resume-entry ul {
    margin-top: 0.025in;
    margin-left: 0.13in;
  }

  .resume-entry li {
    margin: 0.01in 0;
    line-height: 1.21;
  }

  .resume-document a {
    color: inherit;
    text-decoration: none;
  }
}
