@font-face {
  font-family: "IBM Plex Sans Variable";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("./assets/fonts/ibm-plex-sans-latin-variable.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans Variable";
  font-style: italic;
  font-weight: 100 700;
  font-display: swap;
  src: url("./assets/fonts/ibm-plex-sans-latin-variable-italic.woff2") format("woff2");
}

:root {
  --background: oklch(1 0 0);
  --ink: oklch(0 0 0);
  --text: oklch(0 0 0);
  --muted: oklch(0 0 0);
  --border: oklch(0 0 0 / 20%);
  --heading: oklch(0 0 0);
  --accent: oklch(0.837 0.171 91.771);
  --brand-blue: oklch(0.414 0.209 263.002);
  --soft-blue: oklch(0.793 0.106 254.521);
  --soft-gray: oklch(0.94 0 0);
  --focus: var(--ink);
  --shadow: oklch(0 0 0 / 18%);

  font-family: "IBM Plex Sans Variable", sans-serif;
  color: var(--text);
  background: var(--background);
  color-scheme: light;
  font-synthesis: none;
}

:root[data-theme="blue"] {
  --background: oklch(1 0 0);
  --ink: oklch(0.414 0.209 263.002);
  --text: oklch(0.414 0.209 263.002);
  --muted: oklch(0.414 0.209 263.002);
  --border: oklch(0.414 0.209 263.002 / 25%);
  --heading: oklch(0.414 0.209 263.002);
  --accent: oklch(0.793 0.106 254.521);
  --focus: oklch(0.414 0.209 263.002);
  --shadow: oklch(0.414 0.209 263.002 / 18%);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding: 2rem 1rem 10rem;
}

.section-index {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: max(1.5rem, calc(50% - 34rem));
  display: none;
  width: 8rem;
  transform: translateY(-50%);
}

.section-index-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 30%;
  background: var(--accent);
  pointer-events: none;
  transform: translateY(var(--indicator-y, 0.25rem))
    rotate(var(--indicator-rotation, -12deg));
  transform-origin: center;
  transition-property: transform;
  transition-duration: 320ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.section-index a {
  display: flex;
  min-height: 1.25rem;
  padding-inline-start: 1.375rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  opacity: 0.4;
  transition-property: opacity;
  transition-duration: 140ms;
}

.section-index a:hover,
.section-index a:focus-visible {
  opacity: 0.7;
}

.section-index a[aria-current="location"] {
  font-weight: 600;
  opacity: 1;
}

.section-index a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 72rem) {
  .section-index {
    display: block;
  }
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--heading);
  text-wrap: balance;
}

.intro-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.intro-title h1 {
  margin-bottom: 0;
}

.avatar {
  width: 4rem;
  height: 4rem;
  flex: 0 0 auto;
  border: 3px solid var(--accent);
  border-radius: 30%;
  object-fit: cover;
  transform: rotate(-3deg);
}

h1 {
  margin-bottom: 0.5rem;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.11111;
}

h2 {
  margin-bottom: 2rem;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.33333;
}

h3 {
  margin-bottom: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
}

h4 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.55556;
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.77778;
}

strong {
  color: var(--ink);
  font-weight: 600;
}

a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
}

a:hover {
  color: var(--ink);
}

section {
  margin-top: 3.5rem;
}

.lede {
  margin-bottom: 1.5rem;
  color: var(--ink);
  font-size: 1.375rem;
  line-height: 1.45455;
  text-wrap: pretty;
}

.meta,
.role,
.period {
  color: var(--muted);
}

.meta {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.125rem;
  font-size: 1rem;
  line-height: 1.5;
}

.entry {
  padding: 2rem 0 0.5rem;
  border-top: 1px solid var(--border);
}

.entry:last-child {
  padding-bottom: 0;
}

.entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.role,
.period {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.period {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.email-trigger {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  text-decoration: underline;
  vertical-align: baseline;
  cursor: pointer;
  transform-origin: center;
  transition: transform 100ms cubic-bezier(0.2, 0, 0, 1);
}

.email-trigger:active {
  transform: scale(0.97);
}

.email-trigger:hover,
.theme-toggle:hover {
  text-decoration-thickness: 2px;
}

.theme-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.email-trigger:focus-visible,
.theme-toggle:focus-visible,
.email-action:focus-visible,
.email-popover-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.email-popover {
  position: fixed;
  inset: auto;
  width: min(20rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.75rem;
  border: 0;
  border-radius: 1.25rem;
  corner-shape: squircle;
  background: var(--background);
  color: var(--text);
  box-shadow:
    0 0 0 1px var(--border),
    0 1rem 3rem var(--shadow);
  opacity: 0;
  transform: translateY(0.25rem) scale(0.98);
  transform-origin: bottom left;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 140ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
  transition-behavior: allow-discrete;
}

.email-popover:popover-open,
.email-popover[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .email-popover:popover-open {
    opacity: 0;
    transform: translateY(0.25rem) scale(0.98);
  }
}

.email-popover::backdrop {
  background: transparent;
}

.email-popover-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.email-address {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.email-popover-close {
  display: grid;
  flex: 0 0 auto;
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.25rem -0.25rem -0.25rem 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0.5rem;
  corner-shape: squircle;
  background: transparent;
  color: var(--brand-blue);
  font: inherit;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition-property: background-color, transform;
  transition-duration: 100ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.email-popover-close::before {
  position: absolute;
  inset: -0.375rem;
  content: "";
}

.email-popover-close:hover {
  background: var(--soft-gray);
}

.email-actions {
  display: grid;
  width: fit-content;
  margin-top: 1rem;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.email-action {
  display: flex;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 0.625rem;
  corner-shape: squircle;
  background: var(--background);
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition-property: color, background-color, transform;
  transition-duration: 140ms;
}

.email-action-primary,
.email-action:hover {
  background: var(--ink);
  color: var(--background);
}

.email-action-primary:hover {
  background: var(--background);
  color: var(--ink);
}

.email-action:active,
.email-popover-close:active {
  transform: scale(0.96);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 40.0625rem) {
  .avatar {
    width: 4.5rem;
    height: 4.5rem;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.125;
  }

  h2 {
    font-size: 1.75rem;
    line-height: 1.28571;
  }

  h3 {
    font-size: 1.375rem;
    line-height: 1.45455;
  }

  h4 {
    font-size: 1.0625rem;
    line-height: 1.64706;
  }

  p {
    font-size: 1.0625rem;
    line-height: 1.76471;
  }

  .lede {
    font-size: 1.25rem;
    line-height: 1.5;
  }

  .meta,
  .links,
  .role,
  .period {
    font-size: 0.9375rem;
    line-height: 1.46667;
  }
}

@media (max-width: 40rem) {
  h1 {
    font-size: 1.875rem;
    line-height: 1.13333;
  }

  h2 {
    font-size: 1.625rem;
    line-height: 1.30769;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.5;
  }

  h4 {
    font-size: 1.125rem;
    line-height: 1.55556;
  }

  p {
    font-size: 1rem;
    line-height: 1.75;
  }

  .lede {
    font-size: 1.125rem;
    line-height: 1.55556;
  }

  .meta,
  .links,
  .role,
  .period {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .entry-header {
    display: block;
  }

  .period {
    margin-top: 0.25rem;
    text-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section-index a,
  .section-index-indicator,
  .email-popover,
  .email-action,
  .email-popover-close,
  .email-trigger,
  .theme-toggle {
    transition-duration: 0.01ms;
  }
}

@media print {
  html {
    font-size: 12pt;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .theme-toggle {
    display: none;
  }

  a {
    color: inherit;
  }
}
