@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/fraunces-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/source-code-pro-regular.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: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(fonts/source-sans-3-variable.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;
}

/* Self-hosted fonts; licenses are included in assets/fonts/. */
:root {
  --font-body:
    "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono:
    "Source Code Pro", ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: light;
  --paper: #fefefe;
  --ink: #171717;
  --secondary: #454545;
  --accent: #7138b8;
  --heading: #7138b8;
  --link: #6529a8;
  --line: #d8d8d8;
  --link-hover: #4e168b;
  --focus-wash: #f2eafa;
  --work-wash: #f2edf9;
  --work-line: #d7c7e9;
  --technology: #666;
  --title-underline: #cbb2e4;
  --selection: #e8d9fa;
  --selection-text: #231130;
  --glow-top: rgb(151 104 208 / 10%);
  --glow-bottom: rgb(121 133 196 / 6%);
  --texture-opacity: 0.16;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17151c;
  --ink: #eeebf2;
  --secondary: #c2bacb;
  --accent: #b28ada;
  --heading: #cba5ff;
  --link: #c9a5fa;
  --link-hover: #e4ceff;
  --line: #443c4e;
  --focus-wash: #372646;
  --work-wash: #241d30;
  --work-line: #4e3d61;
  --technology: #b5aabd;
  --title-underline: #806394;
  --selection: #583678;
  --selection-text: #fff;
  --glow-top: rgb(126 68 181 / 19%);
  --glow-bottom: rgb(89 94 156 / 10%);
  --texture-opacity: 0.12;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #17151c;
    --ink: #eeebf2;
    --secondary: #c2bacb;
    --accent: #b28ada;
    --heading: #cba5ff;
    --link: #c9a5fa;
    --link-hover: #e4ceff;
    --line: #443c4e;
    --focus-wash: #372646;
    --work-wash: #241d30;
    --work-line: #4e3d61;
    --technology: #b5aabd;
    --title-underline: #806394;
    --selection: #583678;
    --selection-text: #fff;
    --glow-top: rgb(126 68 181 / 19%);
    --glow-bottom: rgb(89 94 156 / 10%);
    --texture-opacity: 0.12;
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 1.5rem;
}
body {
  margin: 0;
  border-top: 4px solid var(--accent);
  background-color: var(--paper);
  color: var(--ink);
  isolation: isolate;
  font: 1rem/1.7 var(--font-body);
}
/* Keep both background layers anchored to the viewport. */
body::after {
  content: "";
  position: fixed;
  inset: 4px 0 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 70% 38rem at 100% 0, var(--glow-top), transparent),
    radial-gradient(
      ellipse 55% 45rem at 0 60rem,
      var(--glow-bottom),
      transparent
    );
}
/* A static texture fades away from the reading column. */
body::before {
  content: "";
  position: fixed;
  inset: 4px 0 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("hexagons.svg");
  background-size: 84px 48.5px;
  opacity: var(--texture-opacity);
  mask-image: linear-gradient(
    to right,
    #000,
    rgb(0 0 0 / 20%) 25%,
    transparent 38%,
    transparent 62%,
    rgb(0 0 0 / 20%) 75%,
    #000
  );
}
p,
h1,
h2,
h3 {
  margin: 0;
}
p + p {
  margin-top: 1rem;
}
h1,
h2 {
  font-family: var(--font-heading);
  color: var(--heading);
  line-height: 1.3;
  font-weight: 600;
  font-optical-sizing: auto;
}
h1 {
  font-size: 2.4rem;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 650;
}
::selection {
  background: var(--selection);
  color: var(--selection-text);
}
a {
  color: var(--link);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 2px;
  background-color: var(--focus-wash);
}
/* The skip target receives focus for navigation, not as an interactive control. */
main[tabindex="-1"]:focus {
  outline: none;
}
.shell {
  width: min(740px, calc(100% - 3rem));
  margin-inline: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -8rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--work-wash);
  color: var(--link);
}
.skip-link:focus {
  top: 1rem;
  z-index: 1;
  outline: 2px solid var(--link);
  outline-offset: 2px;
  text-decoration: none;
  border-radius: 4px;
  background: var(--work-wash);
  color: var(--link);
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
}
.home-header {
  justify-content: flex-end;
}
.wordmark {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration-color: transparent;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration-color: currentColor;
}
.introduction {
  display: flow-root;
  padding-block: 1.6rem 2.4rem;
}
.role {
  color: var(--secondary);
  font-size: 0.9rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.identity > .role {
  margin-top: 0.3rem;
  font-size: 1rem;
}
.bio {
  margin-top: 1.4rem;
}
.technology {
  font-family: var(--font-mono);
  color: var(--technology);
  font-size: 0.72rem;
  line-height: 1.9;
}
#work {
  border-top: 2px solid var(--accent);
  padding-top: 1.5rem;
}
.work-item {
  padding-block: 1.7rem 2rem;
}
.work-item + .work-item {
  border-top: 1px solid var(--line);
}
.project-heading {
  margin-bottom: 0.7rem;
}
.project-heading .role {
  margin-top: 0.4rem;
}
.work-item > .technology {
  margin-top: 0.7rem;
}
.contact {
  border-top: 2px solid var(--accent);
  padding-block: 1.5rem;
}
.contact h2 {
  margin-bottom: 0.8rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
  margin-top: 0.5rem;
}
.actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
}
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1.2rem 2rem;
  font-size: 0.78rem;
  color: var(--secondary);
}
.article-heading {
  padding-block: 0.5rem 1.8rem;
}
.breadcrumb {
  display: inline-block;
  padding-block: 0.55rem;
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
}
.company {
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.article-heading h1 {
  font-size: 2.2rem;
}
.article-heading .role {
  margin-top: 0.5rem;
}
.summary {
  margin-top: 1.2rem;
}
.article-heading .technology {
  margin-top: 1rem;
}
.confidential {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-top: 0.8rem;
}
.prose {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.prose h2 {
  margin: 2.4rem 0 0.9rem;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose h3 {
  margin: 1.4rem 0 0.7rem;
}
.next-work {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-block: 1.2rem;
}
.next-work p {
  color: var(--secondary);
  font-size: 0.8rem;
}
.next-work a {
  display: inline-block;
  padding-block: 0.5rem;
}
@media (max-width: 520px) {
  .shell {
    width: calc(100% - 2.5rem);
  }
  .site-header {
    flex-wrap: wrap;
    gap: 0.1rem 1rem;
    padding-block: 0.6rem;
  }
  .home-header {
    justify-content: flex-start;
  }
  .site-nav {
    gap: 1.3rem;
  }
  .introduction {
    padding-top: 1rem;
  }
  h1 {
    font-size: 2.1rem;
  }
  .article-heading h1 {
    font-size: 1.9rem;
  }
}
@media print {
  body {
    background: white;
    color: black;
  }
  .shell {
    width: 100%;
  }
  .site-header,
  .skip-link,
  .contact,
  .next-work {
    display: none;
  }
  a {
    color: inherit;
  }
  h2,
  h3 {
    break-after: avoid;
  }
}

/* Circular crop of the accepted cleaned-up portrait. */
.portrait {
  width: 160px;
  height: 160px;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}
@media (max-width: 520px) {
  .portrait {
    width: 88px;
    height: 88px;
    margin: 0;
  }
}

.project-heading h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
}
.project-heading h3 a {
  display: inline;
  text-decoration: underline;
  text-decoration-color: var(--title-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
}
.project-heading h3 a:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

/* Keep emphasis sparse within the work accounts. */
.article-heading .company {
  color: var(--link);
}
.prose strong,
.summary strong {
  font-weight: 650;
}

@media (max-width: 520px) {
  .work-item {
    padding-block: 1.4rem 1.7rem;
  }
  .prose h2 {
    margin-top: 2rem;
  }
}

/* A distinct introduction and work area, without changing the reading column. */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}
.identity {
  min-width: 0;
}
.portrait {
  flex: 0 0 auto;
}
.bio {
  margin-top: 1.75rem;
}
#work {
  margin-inline: -2.5rem;
  padding: 1.75rem 2.5rem 0.25rem;
  background: var(--work-wash);
  border-top: 0;
}
.work-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  column-gap: 2rem;
  row-gap: 0.75rem;
  padding-block: 1.8rem 2rem;
}
.work-item + .work-item {
  border-color: var(--work-line);
}
.project-heading {
  display: contents;
}
.project-heading h3 {
  grid-column: 2;
  font-size: 1.5rem;
}
.project-heading .role {
  grid-column: 1;
  grid-row: 1 / span 3;
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  line-height: 1.6;
}
.project-heading .role span {
  display: block;
}
.project-company {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
}
.work-item > p {
  grid-column: 2;
  margin-top: 0;
}
.contact {
  margin-top: 2rem;
}
@media (min-width: 721px) and (max-width: 840px) {
  #work {
    margin-inline: -1.5rem;
    padding-inline: 1.5rem;
  }
}
@media (max-width: 720px) {
  #work {
    margin-inline: -1.5rem;
    padding-inline: 1.5rem;
  }
  .work-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .project-heading h3,
  .project-heading .role,
  .work-item > p {
    grid-column: 1;
    grid-row: auto;
  }
  .project-heading .role {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.75rem;
    margin: 0 0 0.3rem;
  }
  .project-company {
    font-size: inherit;
    margin: 0;
  }
}
@media (max-width: 520px) {
  .masthead {
    gap: 1rem;
  }
  .identity h1 {
    font-size: 1.8rem;
  }
  .identity > .role {
    font-size: 0.9rem;
  }
  #work {
    margin-inline: -1.25rem;
    padding: 1.4rem 1.25rem 0;
  }
  .project-heading h3 {
    font-size: 1.35rem;
  }
}
@media (max-width: 360px) {
  .masthead {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}
@media print {
  #work {
    margin-inline: 0;
    padding-inline: 0;
    background: white;
  }
}

/* Native checkbox semantics and a generous target for the theme switch. */
.site-nav {
  align-items: center;
}
.theme-control:not([hidden]) {
  display: flex;
  align-items: center;
}
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  color: var(--secondary);
  cursor: pointer;
  position: relative;
}
.theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.theme-track {
  display: inline-block;
  position: relative;
  width: 32px;
  height: 20px;
  border: 1px solid var(--secondary);
  border-radius: 12px;
  background: var(--paper);
}
.theme-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary);
}
.theme-switch input:checked + .theme-track {
  background: var(--link);
  border-color: var(--link);
}
.theme-switch input:checked + .theme-track::before {
  transform: translateX(12px);
  background: var(--paper);
}
.theme-switch input:focus-visible + .theme-track {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}
@media (forced-colors: active) {
  .theme-track {
    background: Canvas;
    border-color: CanvasText;
  }
  .theme-track::before {
    background: CanvasText;
  }
  .theme-switch input:checked + .theme-track {
    background: Highlight;
    border-color: Highlight;
  }
  .theme-switch input:checked + .theme-track::before {
    background: HighlightText;
  }
}
@media (max-width: 520px) {
  .site-nav {
    gap: 0.8rem;
  }
}
/* Keep a printable white page regardless of the selected screen theme. */
@media print {
  :root,
  :root[data-theme],
  :root:not([data-theme]) {
    color-scheme: light;
    --paper: #fff;
    --ink: #000;
    --secondary: #333;
    --heading: #000;
    --link: #000;
    --technology: #444;
    --line: #bbb;
    --work-wash: #fff;
    --work-line: #bbb;
  }
}

@media print, (forced-colors: active) {
  body {
    background-image: none;
  }
  body::before,
  body::after {
    display: none;
  }
}
