/* A layered personal portrait, with all drafting details outside the face. */
.about-portrait.portrait-card {
  --portrait-edge: color-mix(in srgb, var(--accent) 30%, var(--line));
  position: relative;
  isolation: isolate;
  width: min(100%, 440px);
  padding: 0;
  margin: 35px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: none;
}
.portrait-card .portrait-composition {
  position: relative;
  padding: 39px 30px 0 0;
}
.portrait-card .portrait-backplate {
  position: absolute;
  inset: 0 0 25px 35px;
  z-index: -2;
  overflow: hidden;
  border: 1px solid var(--portrait-edge);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at var(--portrait-light-x, 50%) var(--portrait-light-y, 50%),
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 22px,
      color-mix(in srgb, var(--accent) 7%, transparent) 22px 23px
    ),
    var(--surface);
}
.portrait-card .portrait-backplate::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.portrait-card .portrait-ghost-mark {
  position: absolute;
  top: 52px;
  right: 11px;
  color: color-mix(in srgb, var(--accent) 15%, transparent);
  font-size: clamp(66px, 8vw, 108px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.08em;
  writing-mode: vertical-rl;
}
.portrait-card .portrait-plate-note {
  position: absolute;
  right: 7px;
  bottom: 35px;
  color: var(--muted);
  font: 400 7px/1.2 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}
.portrait-card .portrait-plate-sheen {
  position: absolute;
  inset: -20% -80%;
  background: linear-gradient(
    115deg,
    transparent 38%,
    color-mix(in srgb, var(--accent) 16%, transparent) 49%,
    transparent 60%
  );
  transform: translateX(-70%);
  animation: portrait-plate-sheen 14s ease-in-out infinite;
}
.portrait-card .portrait-drafting {
  position: absolute;
  z-index: -1;
  top: -15px;
  right: 2px;
  width: 94%;
  height: auto;
  color: var(--accent);
  pointer-events: none;
}
.portrait-card .portrait-drafting-guide {
  stroke: var(--portrait-edge);
  stroke-width: 0.7;
}
.portrait-card .portrait-drafting-orbit {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.55;
  transform-origin: 50% 50%;
  animation: portrait-drafting-orbit 80s linear infinite;
}
.portrait-card .portrait-drafting-point {
  fill: var(--accent);
  stroke: none;
}
.portrait-card .portrait-drafting-ticks {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.45;
}
.portrait-card .portrait-edition {
  position: absolute;
  z-index: 1;
  top: 15px;
  left: 58px;
  right: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font: 400 7px/1.5 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.portrait-card .portrait-edition > span {
  color: var(--accent);
  white-space: nowrap;
}
.portrait-card .portrait-visual-frame {
  position: relative;
  z-index: 2;
  padding: 8px;
  border: 1px solid var(--portrait-edge);
  border-radius: 116px 23px 23px 23px;
  background: var(--surface-raised);
  box-shadow:
    0 26px 48px -27px color-mix(in srgb, var(--text) 24%, transparent),
    0 0 0 5px color-mix(in srgb, var(--accent) 3%, transparent);
  transform: none;
}
.portrait-card .portrait-photo {
  aspect-ratio: 4 / 5;
  border-radius: 108px 16px 16px 16px;
  background: var(--surface);
}
.portrait-card .portrait-photo::after {
  background: none;
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}
.portrait-card .portrait-photo > img,
.portrait-card:hover .portrait-photo > img {
  object-fit: cover;
  object-position: 50% 50%;
  transform: none;
  transition: none;
}
.portrait-card[data-portrait-morph] .portrait-photo > img {
  position: absolute;
  inset: 0;
}
.portrait-card .portrait-hacker {
  opacity: 0;
}
:root[data-theme="dark"] .portrait-card .portrait-hacker {
  opacity: 1;
}
:root .portrait-card[data-portrait-image-failed="true"] .portrait-hacker {
  opacity: 0;
}
/* Older browsers crossfade the photo with the fallback page fade. */
:root.theme-fade .portrait-card .portrait-hacker {
  transition: opacity 0.48s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
:root[data-motion="paused"] .portrait-card .portrait-hacker {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  :root.theme-fade .portrait-card .portrait-hacker {
    transition: none !important;
  }
}
.portrait-card .portrait-frame-ticks {
  position: absolute;
  left: 1px;
  top: 42%;
  width: 12px;
  height: 110px;
  stroke: var(--accent);
  stroke-width: 0.8;
  opacity: 0.65;
  pointer-events: none;
}
.portrait-card .portrait-frame-corner {
  position: absolute;
  width: 27px;
  height: 27px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.75;
  pointer-events: none;
}
.portrait-card .portrait-frame-corner-top {
  top: 16px;
  right: 16px;
  border-width: 1px 1px 0 0;
  border-top-right-radius: 4px;
}
.portrait-card .portrait-frame-corner-bottom {
  bottom: 16px;
  left: 16px;
  border-width: 0 0 1px 1px;
  border-bottom-left-radius: 4px;
}
.portrait-card .portrait-identity {
  position: relative;
  z-index: 3;
  display: block;
  width: calc(100% - 26px);
  padding: 17px 20px 12px;
  margin: -31px 0 0 26px;
  border: 1px solid var(--portrait-edge);
  border-radius: 11px;
  background: var(--surface-raised);
  box-shadow: 0 15px 30px -23px color-mix(in srgb, var(--text) 30%, transparent);
}
.portrait-card .portrait-identity::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  width: 62px;
  height: 2px;
  background: var(--accent);
}
.portrait-card .portrait-identity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font: 400 7px/1.6 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.portrait-card .portrait-identity-top > span:last-child {
  font-size: 16px;
  line-height: 0.7;
  color: var(--accent);
}
.portrait-card .portrait-identity-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}
.portrait-card .portrait-identity-main strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.portrait-card .portrait-identity-main > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.portrait-card .portrait-identity-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 41px;
  width: 41px;
  height: 41px;
  border: 1px solid var(--portrait-edge);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
  color: var(--accent);
  font: 400 13px/1 var(--font-mono);
  letter-spacing: -0.1em;
}
.portrait-card .portrait-identity-mark > span {
  position: absolute;
  inset: 4px;
  border: 1px dashed var(--portrait-edge);
  border-radius: 50%;
}
.portrait-card .portrait-identity-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.portrait-card .portrait-identity-bottom > span:first-child {
  color: var(--muted);
  font: 400 7px/1.6 var(--font-mono);
}
.portrait-card .portrait-signature {
  color: var(--accent);
  font:
    italic 27px/1 "Instrument Serif",
    Georgia,
    serif;
  letter-spacing: -0.04em;
}
.portrait-card .portrait-motion {
  animation-play-state: paused;
}
.portrait-card[data-portrait-running="true"] .portrait-motion {
  animation-play-state: running;
}
:root[data-motion="paused"] .portrait-card .portrait-motion {
  animation-play-state: paused;
}
@keyframes portrait-plate-sheen {
  0%,
  15%,
  100% {
    transform: translateX(-70%);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  45%,
  95% {
    transform: translateX(70%);
    opacity: 0;
  }
}
@keyframes portrait-drafting-orbit {
  to {
    transform: rotate(360deg);
  }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="paused"])
    .portrait-card[data-portrait-running="true"]
    .portrait-visual-frame {
    transform: perspective(1100px) rotateX(var(--portrait-tilt-x, 0deg))
      rotateY(var(--portrait-tilt-y, 0deg));
    transition:
      transform 0.45s ease,
      box-shadow 0.45s ease;
  }
  :root:not([data-motion="paused"])
    .portrait-card[data-portrait-running="true"]:hover
    .portrait-visual-frame {
    box-shadow:
      0 30px 55px -26px color-mix(in srgb, var(--text) 28%, transparent),
      0 0 0 5px color-mix(in srgb, var(--accent) 6%, transparent);
  }
}
@media (max-width: 1000px) {
  .portrait-card .portrait-composition {
    padding-right: 22px;
  }
  .portrait-card .portrait-identity {
    width: calc(100% - 16px);
    margin-left: 16px;
    padding-inline: 15px;
  }
  .portrait-card .portrait-identity-main strong {
    font-size: 18px;
  }
  .portrait-card .portrait-identity-main > div > span {
    font-size: 9px;
  }
  .portrait-card .portrait-identity-mark {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
    font-size: 11px;
  }
}
@media (max-width: 700px) {
  .about-portrait.portrait-card {
    width: min(100%, 350px);
    margin: 29px auto 0;
  }
  .portrait-card .portrait-composition {
    padding-top: 33px;
    padding-right: 23px;
  }
  .portrait-card .portrait-edition {
    top: 12px;
    left: 48px;
    font-size: 6px;
  }
  .portrait-card .portrait-backplate {
    left: 27px;
  }
  .portrait-card .portrait-visual-frame {
    padding: 6px;
    border-top-left-radius: 96px;
  }
  .portrait-card .portrait-photo {
    border-top-left-radius: 89px;
  }
  .portrait-card .portrait-plate-note {
    right: 4px;
    font-size: 6px;
  }
  .portrait-card .portrait-identity {
    margin-top: -23px;
  }
}
@media (max-width: 359px) {
  .portrait-card .portrait-identity-main {
    gap: 8px;
  }
  .portrait-card .portrait-identity-main strong {
    font-size: 17px;
  }
  .portrait-card .portrait-identity-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 10px;
  }
  .portrait-card .portrait-identity-bottom {
    gap: 8px;
  }
  .portrait-card .portrait-signature {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-card .portrait-motion {
    animation: none !important;
  }
  .portrait-card .portrait-visual-frame,
  .portrait-card .portrait-photo > img {
    transform: none;
    transition: none;
  }
}
