:root {
  color-scheme: light dark;
  --paper: #fafafa;
  --ink: #1d1d1f;
  --muted: #a2a2a2;
  --faint: #ededed;
  --link-underline: #d8d8d8;
  --selection: #dedede;
  --measure: 40rem;
  --text-lg: 1.25rem;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --leading-tight: 1.2;
  --leading-normal: 1.45;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--paper);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 160ms ease;
}

a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3 {
  font-weight: inherit;
}

a:focus-visible,
button:focus-visible {
  border-radius: 0.1rem;
  outline: 0.15rem solid currentColor;
  outline-offset: 0.22rem;
}

::selection {
  background: var(--selection);
  color: #111;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.75rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  transform: translateY(0);
}

.resume {
  width: min(calc(100% - 2.5rem), var(--measure));
  margin-inline: auto;
  padding-block: clamp(1.75rem, 4vw, 3rem);
}

.identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(1rem, 4vw, 2rem);
}

.identity h1 {
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
}

.headline {
  max-width: 34rem;
  margin: 0.35rem 0 0;
  font-size: var(--text-sm);
}

.location {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.portrait {
  align-self: start;
  width: clamp(3.5rem, 9vw, 4.25rem);
  height: clamp(3.5rem, 9vw, 4.25rem);
  border-radius: 0.45rem;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.04);
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin-top: 0.4rem;
}

.contact-list a {
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.contact-list a:hover {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
}

.contact-list svg {
  width: 0.9rem;
  height: 0.9rem;
}

.print-contact {
  display: none;
}

.resume-section {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.section-heading {
  margin: 0 0 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--faint);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}

.summary {
  max-width: 42rem;
  margin: 0;
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.experience-list,
.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.experience-list > li + li {
  margin-top: 1.25rem;
}

.experience-list > li:not(:last-child) .experience-item {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--faint);
}

.entry-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
}

.entry-heading h3,
.project-item h2 {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-tight);
}

.role,
.education-item p,
.project-item p {
  margin: 0.25rem 0 0;
}

.role {
  color: var(--muted);
  font-size: var(--text-sm);
}

.period {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.period span {
  margin-inline: 0.3em;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0.35rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  list-style: none;
}

.meta-list li:not(:last-child)::after {
  margin-inline: 0.45rem;
  content: "·";
}

.entry-body {
  margin-top: 0.5rem;
  color: var(--ink);
  font-size: var(--text-sm);
}

.entry-body p {
  margin: 0;
}

.entry-body ul {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.entry-body li {
  position: relative;
  padding-left: 1rem;
}

.entry-body li::before {
  position: absolute;
  left: 0;
  color: var(--muted);
  content: "—";
}

.entry-body li + li {
  margin-top: 0.18rem;
}

.project-item p {
  color: var(--muted);
  font-size: var(--text-sm);
  text-wrap: pretty;
}

.projects-link {
  display: inline;
}

.project-shell {
  width: min(calc(100% - 2.5rem), var(--measure));
  margin-inline: auto;
  padding-block: clamp(1.75rem, 4vw, 3rem);
}

.projects-header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.projects-header h1 {
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
}

.project-list {
  border-top: 1px solid var(--faint);
}

.project-item {
  padding-block: 1rem;
  border-bottom: 1px solid var(--faint);
}

.project-item p {
  max-width: 34rem;
  margin: 0.35rem 0 0;
}

@keyframes resume-exit {
  to {
    opacity: 0.35;
    transform: translateY(-0.45rem) scale(0.995);
  }
}

@keyframes projects-enter {
  from {
    opacity: 0.35;
    transform: translateY(0.75rem) scale(0.995);
  }
}

@keyframes projects-exit {
  to {
    opacity: 0.35;
    transform: translateY(0.75rem) scale(0.995);
  }
}

@keyframes resume-enter {
  from {
    opacity: 0.35;
    transform: translateY(-0.45rem) scale(0.995);
  }
}

html[data-page-exit] {
  pointer-events: none;
}

html[data-page-exit="projects"] .resume {
  animation: resume-exit 220ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

html[data-page-enter="projects"] .project-shell {
  animation: projects-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-page-exit="resume"] .project-shell {
  animation: projects-exit 220ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

html[data-page-enter="resume"] .resume {
  animation: resume-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.education-item p:not(.period) {
  color: var(--muted);
  font-size: var(--text-sm);
}

.resume-footer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
  padding-top: 0.75rem;
  border-top: 1px solid var(--faint);
  color: var(--muted);
  font-size: var(--text-xs);
}

.print-action {
  appearance: none;
  min-height: 2.75rem;
  margin: -0.75rem 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0e0e;
    --ink: #ededed;
    --muted: #777;
    --faint: #242424;
    --link-underline: #454545;
    --selection: #3b3b3b;
  }

  .portrait {
    filter: saturate(0.74) contrast(1.05) brightness(0.9);
  }
}

@media (max-width: 40rem) {
  .resume,
  .project-shell {
    width: min(calc(100% - 2.25rem), var(--measure));
    padding-block: 1.5rem 3rem;
  }

  .identity {
    gap: 1rem;
  }

  .portrait {
    width: 3.5rem;
    height: 3.5rem;
  }

  .contact-list {
    gap: 0.45rem;
  }

  .contact-list a {
    width: 2.5rem;
    height: 2.5rem;
  }

  .entry-heading {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .period {
    grid-row: 2;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  :root {
    --paper: #fff;
    --ink: #000;
    --muted: #4a4a4a;
    --faint: #cfcfcf;
  }

  html,
  body {
    background: #fff;
    color: #000;
    font-size: 9.5pt;
  }

  .skip-link,
  .resume-footer {
    display: none;
  }

  .resume,
  .project-shell {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .identity h1 {
    font-size: 22pt;
  }

  .portrait {
    width: 18mm;
    height: 18mm;
    filter: grayscale(1);
  }

  .contact-list {
    display: none;
  }

  .print-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 2mm 4mm;
    margin-top: 2mm;
    color: var(--muted);
    font-size: 8pt;
  }

  .resume-section {
    margin-top: 7mm;
  }

  .section-heading {
    margin-bottom: 4mm;
    padding-top: 2.5mm;
  }

  .experience-list > li + li {
    margin-top: 5mm;
  }

  .entry-body {
    margin-top: 2mm;
  }

  .entry-body ul,
  .meta-list {
    margin-top: 1.5mm;
  }

  .experience-item,
  .project-item,
  .education-item {
    break-inside: avoid;
  }

}
