:root {
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #d9d9d9;
  --emoji-gold: #ffd767;
  --max: 1220px;
  --pad: clamp(20px, 4vw, 56px);
}

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

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code {
  font-family: inherit;
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-right: var(--pad);
  padding-left: var(--pad);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  padding: 17px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.hello {
  font-size: 30px;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.nav a {
  font-size: 21px;
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover,
.hello:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav a[aria-current="page"]:not(.nav__emoji) {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav__emoji {
  font-size: 44px;
  line-height: 1;
  text-decoration: none;
}

.nav__emoji:hover {
  text-decoration: none;
}

/* Home -------------------------------------------------------------------- */

.home {
  padding-top: clamp(18px, 2.7vw, 36px);
  padding-bottom: 120px;
}

.intro {
  display: grid;
  grid-template-areas:
    "left name"
    "left text";
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  grid-template-rows: auto auto;
  gap: clamp(24px, 3vw, 36px) clamp(36px, 6vw, 96px);
  align-items: start;
}

.intro__left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vw, 36px);
}

.portrait {
  margin: 0;
}

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
}

.intro__text {
  grid-area: text;
}

.intro h1 {
  grid-area: name;
  margin: 0;
}

h1 {
  margin: 0 0 clamp(24px, 3vw, 36px);
  font-size: clamp(3rem, 5vw, 4.75rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.bio {
  max-width: 36em;
  margin: 0;
  color: #222222;
  font-size: 17px;
  line-height: 1.65;
}

.bio p {
  margin: 0 0 1em;
}

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

.role {
  width: 100%;
  max-width: 612px;
  margin: clamp(28px, 4vw, 40px) 0 0;
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
  text-align: right;
}

.role a {
  display: block;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.role a:hover,
.role a:focus-visible {
  background: #052962;
  color: #ffffff;
}

.role em {
  font-weight: 700;
  font-style: italic;
}

/* Previous experience ----------------------------------------------------- */

.experience {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 20px;
}

.previously {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-size: 17px;
}

.experience-selector {
  width: 100%;
}

.experience-picker {
  position: relative;
  width: 100%;
}

.experience-toggle {
  display: inline-flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid var(--ink);
  background: #ffffff;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.experience-toggle:hover,
.experience-toggle:focus-visible {
  background: var(--emoji-gold);
}

.caret {
  flex: 0 0 auto;
  padding-top: 2px;
  font-size: 11px;
  line-height: 1;
}

.experience-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 100%;
  border: 1px solid var(--ink);
  background: #ffffff;
}

.experience-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.experience-menu button:last-child {
  border-bottom: 0;
}

.experience-menu button:hover {
  background: #f3f3f3;
}

.experience-menu button[aria-current="true"] {
  font-weight: 600;
}

.experience-panels {
  margin-top: clamp(28px, 4vw, 40px);
}

.experience-panel {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) auto;
  gap: 12px 40px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.experience-panel[hidden] {
  display: none;
}

.experience-panel__date {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.experience-panel__body h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.experience-panel__body p {
  max-width: 60ch;
  margin: 0;
  color: #333333;
  font-size: 16px;
  line-height: 1.6;
}

.experience-panel__body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.experience-media:empty {
  display: none;
}

.experience-media img {
  width: 140px;
  height: auto;
}

/* Inner pages -------------------------------------------------------------- */

.page {
  padding-top: clamp(30px, 5vw, 60px);
  padding-bottom: 120px;
}

.page__inner {
  max-width: 800px;
}

.page h1 {
  margin: 0 0 30px;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.page p {
  max-width: 38em;
  margin: 0 0 14px;
}

.placeholder {
  color: var(--muted);
}

.download {
  display: inline-block;
  font-size: 18px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-list {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px 24px;
  margin: 0;
}

.contact-list dt {
  color: var(--muted);
}

.contact-list dd {
  margin: 0;
}

.contact-list a {
  text-underline-offset: 3px;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 820px) {
  .intro {
    grid-template-areas:
      "name"
      "portrait"
      "text"
      "selector";
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .intro__left {
    display: contents;
  }

  .portrait {
    grid-area: portrait;
    max-width: 440px;
  }

  .experience-selector {
    grid-area: selector;
  }

  h1 {
    font-size: clamp(2.8rem, 10vw, 4rem);
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 13px 0;
  }

  .site-header__inner {
    gap: 16px;
  }

  .nav {
    gap: 16px;
  }

  .hello {
    font-size: 27px;
  }

  .nav a {
    font-size: 19px;
  }

  .nav__emoji {
    font-size: 40px;
  }

  .home {
    padding-top: 15px;
    padding-bottom: 80px;
  }

  .previously {
    display: block;
  }

  .experience-picker {
    margin-top: 10px;
  }

  .experience-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .experience-menu {
    width: 100%;
    max-width: none;
  }

  .experience-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page {
    padding-bottom: 80px;
  }

  .contact-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .contact-list dt {
    margin-top: 14px;
  }
}

@media (max-width: 380px) {
  .site-header__inner {
    gap: 8px;
  }

  .nav {
    gap: 8px;
  }

  .hello {
    font-size: 23px;
  }

  .nav a {
    font-size: 16px;
  }

  .nav__emoji {
    font-size: 37px;
  }
}
