:root {
  color-scheme: light;
  --page: #f5f1fa;
  --ink: #38284b;
  --body: #62546f;
  --purple: #65458c;
  --icon: #785897;
  --frame: #67448e;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.homepage {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 64px 24px 88px;
}

.introduction {
  width: 100%;
  max-width: 660px;
  text-align: center;
}

.portrait-frame,
.portrait {
  clip-path: polygon(50% 0%, 90% 20%, 100% 62%, 75% 100%, 25% 100%, 0% 62%, 10% 20%);
}

.portrait-frame {
  width: 196px;
  height: 196px;
  padding: 5px;
  margin: 0 auto 32px;
  background: var(--frame);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

h1 strong {
  font-weight: 650;
}

.introduction-copy {
  max-width: 540px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.8;
  text-wrap: pretty;
}

.introduction-copy a {
  color: var(--purple);
  font-weight: 550;
  text-decoration-line: underline;
  text-decoration-color: #bba8d0;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.introduction-copy a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 5px;
  border-radius: 2px;
}

.profile-navigation {
  margin-top: 34px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--icon);
  text-decoration: none;
  transition: background-color 160ms ease;
}

.profile-link:focus-visible {
  border-radius: 50%;
}

.profile-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

#email, #resume { --hover-color: gray; --tooltip-text: #111111; }
#li { --hover-color: darkblue; }

.profile-link:hover,
.profile-link:focus-visible {
  background-color: var(--hover-color);
}

/* Labels remain reachable by pointer and can be dismissed with Escape. */
.link-tooltip {
  position: absolute;
  z-index: 1;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 4px;
  background-color: var(--hover-color);
  color: var(--tooltip-text, #fff);
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  visibility: hidden;
}

.link-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: calc(50% - 4px);
  border: 4px solid transparent;
  border-top-color: var(--hover-color);
}

/* Bridge the gap so the label stays visible when the pointer enters it. */
.link-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 8px;
}

.profile-link:hover .link-tooltip,
.profile-link:focus-visible .link-tooltip {
  visibility: visible;
}

.profile-link.tooltip-dismissed .link-tooltip {
  visibility: hidden;
}

@media (forced-colors: active) {
  .profile-link {
    border: 2px solid LinkText;
    color: LinkText;
  }

  .link-tooltip {
    border: 1px solid CanvasText;
  }
}

@media (max-width: 480px) {
  .homepage {
    padding: 48px 20px 64px;
  }

  .portrait-frame {
    width: 160px;
    height: 160px;
    padding: 4px;
    margin-bottom: 28px;
  }

  .introduction-copy {
    margin-top: 18px;
    font-size: 17px;
    line-height: 1.75;
  }

  .profile-navigation {
    margin-top: 28px;
  }

  .profile-links {
    max-width: 294px;
    margin-inline: auto;
    column-gap: 6px;
  }
}

@media (max-width: 360px) {
  .profile-links {
    max-width: 274px;
    column-gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-link {
    transition: none;
  }
}
