@font-face {
  font-family: "Geist Sans";
  src: url("assets/geist-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Caveat;
  src: url("assets/caveat-loki.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+69, U+6B-6C, U+6F;
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#faf9f6, #232421);
  --ink: light-dark(#252721, #eeece4);
  --muted: light-dark(#585e54, #c7c8be);
  --detail-ink: light-dark(#62685f, #b8b9af);
  --accent: light-dark(#355840, #bfd8bb);
  --link-underline: light-dark(#708b73, #91ab8d);
  --rule: light-dark(#e4e5de, #41433c);
  --detail-rule: light-dark(#d6d9d0, #52564b);
  --image-backdrop: light-dark(#e5e9e0, #383a34);
  --photo-shadow-near: light-dark(rgb(45 36 27 / 0.09), rgb(0 0 0 / 0.48));
  --photo-shadow-far: light-dark(rgb(45 36 27 / 0.23), rgb(0 0 0 / 0.64));
  font-family: "Geist Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p, ul {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration-color: var(--link-underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.page {
  width: min(100% - 3rem, 35rem);
  margin-inline: auto;
  padding-block: clamp(2.65rem, 7vw, 4.5rem) 4.5rem;
}

.portrait-heading {
  --name-size: clamp(1.6875rem, 9.18vw, 3.6rem);
  --theme-hit-area: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(var(--theme-hit-area), 1fr);
}

.portrait-heading > h1 {
  grid-column: 1;
  grid-row: 2;
}

.theme-toggle {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: var(--theme-hit-area);
  height: var(--theme-hit-area);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  /* Lower the icon from the line-box center to the lowercase letter center. */
  transform: translateY(calc(var(--name-size) * 0.08));
}

.theme-toggle:disabled {
  visibility: hidden;
}

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

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle[data-mode="dark"] .theme-moon,
.theme-toggle:not([data-mode="dark"]) .theme-sun {
  display: none;
}

.photo-stack {
  position: relative;
  isolation: isolate;
  grid-column: 1;
  width: clamp(11.25rem, 42vw, 15.75rem);
  max-width: 100%;
  justify-self: center;
  margin-block-end: clamp(0.875rem, 2.1vw, 1.375rem);
}

.photo-backs {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: rotate(var(--photo-tilt, -1.5deg));
}

.photo-backs span {
  position: absolute;
  inset: 0;
  border: 1px solid light-dark(#cfc9bd, #c8bba6);
  background: light-dark(#eee9df, #e2d5c0);
}

.photo-backs span:nth-child(1) {
  transform: translateY(5px) rotate(0.2deg);
}

.photo-backs span:nth-child(2) {
  transform: translate(3px, 2px) rotate(1.5deg);
}

.photo-backs span:nth-child(3) {
  transform: translate(-3px, 2px) rotate(-1.45deg);
}

.instant-photo {
  --photo-bottom-border: 2.25rem;
  display: block;
  width: 100%;
  transform: rotate(var(--photo-tilt, -1.5deg));
  padding: 0.55rem 0.55rem var(--photo-bottom-border);
  border: 1px solid light-dark(rgb(0 0 0 / 0.08), #d9ccb7);
  background: light-dark(#fffdf8, #eee5d5);
  box-shadow: 0 2px 4px var(--photo-shadow-near), 0 12px 18px -12px var(--photo-shadow-far);
  color: var(--ink);
}

.instant-photo:enabled {
  cursor: pointer;
}

.photo-window {
  display: grid;
  aspect-ratio: 1;
  background: #e5e9e0;
}

.photo-slide {
  position: relative;
  grid-area: 1 / 1;
  opacity: 0;
}

.photo-slide.is-active {
  z-index: 1;
  opacity: 1;
}

.photo-caption {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  display: grid;
  place-items: center;
  block-size: var(--photo-bottom-border);
  color: #42453d;
  font: 500 1.35rem/1 Caveat, "Bradley Hand", cursive;
}

.photo-cue {
  position: absolute;
  inset-inline-end: 0.6rem;
  inset-block-end: 0.58rem;
  color: #42453d;
  font: 500 0.75rem/1.2 "Geist Sans", system-ui, sans-serif;
}

.instant-photo:disabled .photo-cue {
  visibility: hidden;
}

.photo-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .instant-photo {
    transition: transform 240ms ease;
  }

  .photo-slide {
    transition: opacity 240ms ease;
  }

  .photo-backs {
    transition: opacity 160ms ease, transform 240ms ease;
  }
}

@media (hover: hover) and (pointer: fine) {
  .instant-photo:enabled:hover + .photo-backs {
    opacity: 1;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .instant-photo:enabled:hover {
    transform: translateY(-2px) rotate(calc(var(--photo-tilt, -1.5deg) - 0.55deg));
  }
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e5e9e0;
}

h1 {
  font-size: var(--name-size);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.04em;
  /* Bring the visible edge of the initial D onto the shared text axis. */
  text-indent: -0.045em;
}

.not-found-title {
  --name-size: clamp(2rem, 7vw, 3.6rem);
}

.bio {
  margin-block-start: 0.75rem;
  font-size: 1.0625rem;
}

.personal-note {
  margin-block-start: 0.45rem;
  color: var(--muted);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.35rem;
  margin-block-start: 0.65rem;
  font-weight: 600;
}

.intro-actions a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.5rem;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.35rem;
  margin-block-start: 0.8rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 550;
}

.contact a {
  display: inline-block;
  padding-block: 0.25rem;
}

.experience {
  margin-block-start: clamp(2.25rem, 5.5vw, 3.6rem);
}

h2 {
  margin-block-end: 1.1rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
}

.roles {
  display: grid;
  gap: 1.3rem;
}

.role-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: baseline;
  padding-block: 0.25rem;
  width: 100%;
  padding-inline: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.company, h3 {
  display: block;
  font-size: 1.25rem;
  font-weight: 550;
  line-height: 1.36;
  letter-spacing: -0.018em;
}

.disclosure {
  display: inline-block;
  color: var(--muted);
  line-height: 0;
}

.company .disclosure {
  margin-inline-start: 0.25rem;
  vertical-align: 0.17em;
}

.disclosure::before {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

details[open] > summary .disclosure::before {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .disclosure::before {
    transition: transform 150ms ease;
  }
}

.role-summary:hover .disclosure,
.project-details summary:hover .disclosure {
  color: var(--accent);
}

.company, .position {
  grid-column: 1;
}

.position {
  margin-block-start: 0.15rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.roles .dates {
  grid-column: 2;
  grid-row: 1;
  text-align: end;
}

.role-highlight {
  grid-column: 1 / -1;
  max-width: 31rem;
  margin-block-start: 0.45rem;
  color: var(--muted);
}

.dates {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.role-details, .technical-details {
  max-width: 30rem;
  margin-block-start: 0.45rem;
  padding-inline-start: 0.875rem;
  border-inline-start: 1px solid var(--detail-rule);
  color: var(--detail-ink);
  font-size: 0.9375rem;
}

.role-details p + p, .technical-details p + p {
  margin-block-start: 0.5rem;
}

.technologies {
  font-size: 0.8125rem;
}

.work {
  margin-block-start: clamp(3.5rem, 7vw, 4.75rem);
}

.projects article + article {
  margin-block-start: 1.65rem;
}

.project-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.55rem;
}

.project-destination {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  font-size: 0.875rem;
  font-weight: 550;
}

.project-details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2rem;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  list-style: none;
}

.project-details[open] summary {
  margin-block-start: 0.15rem;
}

.projects article > p {
  margin-block-start: 0.25rem;
  color: var(--muted);
}

.more-work {
  margin-block-start: clamp(2.25rem, 5.5vw, 3.6rem);
}

.more-work .projects article + article {
  margin-block-start: 1.1rem;
}

.project-status {
  font-size: 0.875rem;
  font-weight: 550;
}

.project-figure, .aspect-comparison {
  margin: 0.8rem 0 0;
}

.project-figure + p, .aspect-comparison + p {
  margin-block-start: 0.5rem;
}

.project-image {
  display: block;
  width: 100%;
  height: auto;
  background: var(--image-backdrop);
}

.trip-preview {
  max-width: 19rem;
}

figcaption {
  margin-block-start: 0.35rem;
  color: var(--detail-ink);
  font-size: 0.875rem;
}

.aspect-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 21rem;
}

.aspect-pair > div {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 0.3rem;
  text-align: center;
  font-size: 0.875rem;
}

.aspect-frame {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px solid var(--detail-rule);
  background: var(--image-backdrop);
}

.aspect-frame::before {
  content: "";
  width: 100%;
  aspect-ratio: 16 / 9;
  background: light-dark(#c8d7c7, #596d57);
}

.aspect-expanded {
  aspect-ratio: 4 / 3;
}

.certification {
  margin-block-start: 0.5rem;
}

.case-page h1 {
  --name-size: clamp(2rem, 7.8vw, 3.6rem);
}

.case-page .back-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
  margin-block-end: 1rem;
  font-size: 0.9375rem;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.15rem;
  margin-block-start: 0.65rem;
}

.case-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2rem;
}

.case-section {
  margin-block-start: 2rem;
}

.case-section h2 {
  margin-block-end: 0.55rem;
}

.case-section p + p {
  margin-block-start: 0.75rem;
}

.case-section li + li {
  margin-block-start: 0.35rem;
}

.case-section .project-figure {
  max-width: 22rem;
}

.education {
  margin-block-start: clamp(3.25rem, 6vw, 4.25rem);
  font-size: 0.9375rem;
}

.education h2 {
  margin-block-end: 0.35rem;
}

.contact-footer {
  margin-block-start: clamp(2.75rem, 6vw, 4rem);
  padding-block-start: 1.2rem;
  border-block-start: 1px solid var(--rule);
}

.contact-footer h2 {
  margin-block-end: 0;
}

.contact-footer .contact {
  margin-block-start: 0.35rem;
}

@media (max-width: 30rem) {
  .role-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .roles .dates {
    grid-column: 1;
    grid-row: auto;
    text-align: start;
  }
}

@media (max-width: 27rem) {
  .portrait-heading {
    --name-size: clamp(1.6875rem, 8.9vw, 3.6rem);
  }
}

@media (max-width: 24rem) {
  .page {
    width: calc(100% - 2.5rem);
  }

  .contact {
    column-gap: 1rem;
  }
}
