.portfolio {
  position: relative;
  min-height: 100svh;
  background: linear-gradient(180deg, #fafaf9 8%, #f8f8f7 53%, #f2f2f1 100%);
  color: #202020;
}

.portfolio-scene {
  position: relative;
  isolation: isolate;
  width: min(100%, 180svh);
  height: 100svh;
  min-height: 450px;
  margin-inline: auto;
  overflow: hidden;
  container-type: inline-size;
}

.portfolio-title {
  position: absolute;
  inset: 6.5% 0 auto;
  margin: 0;
  font: 700 15.58cqw/.82 "Instrument Sans", Arial, sans-serif;
  text-align: center;
  outline: none;
  white-space: nowrap;
  user-select: none;
}

.avatar {
  position: absolute;
  z-index: 2;
  top: 26.63%;
  left: 49.8%;
  width: 40.87%;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

.avatar-base {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 11px 24px rgb(38 38 41 / 8%));
}

.eye-layer {
  position: absolute;
  top: 15.3788%;
  left: 16.6667%;
  width: 67.1362%;
  height: auto;
  opacity: 0;
  transition: opacity 135ms ease;
}

.eye-closed, .eye-slit { transition: none; }
.portfolio[data-active="folder"] .eye-folder,
.portfolio[data-active="player"] .eye-player,
.portfolio[data-active="growth"] .eye-growth { opacity: 1; }

.entry {
  --icon-shadow: drop-shadow(4px 14px 19px rgb(40 40 44 / 18%));
  position: absolute;
  top: var(--y);
  left: calc(var(--x) - var(--width) / 2);
  width: var(--width);
  border: 0;
  background: transparent;
  color: #4a4a49;
  text-align: center;
  font: inherit;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.entry-folder {
  --x: 21.825%;
  --y: 46%;
  --width: 15.54%;
  --from-x: 25.8cqw;
  --from-y: 3.15svh;
  --shine-delay: 71ms;
}

.entry-player {
  --x: 76.125%;
  --y: 37.05%;
  --width: 16.73%;
  --from-x: -24.6cqw;
  --from-y: 4svh;
  --shine-delay: 105ms;
}

.entry-growth {
  --x: 77.51%;
  --y: 63.79%;
  --width: 14.29%;
  --from-x: -24.6cqw;
  --from-y: -9.5svh;
  --shine-delay: 137ms;
}

.entry-icon {
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.icon-rest, .icon-active {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  filter: var(--icon-shadow);
}
.icon-rest { transition: opacity 160ms ease; }

.icon-active {
  position: absolute;
  inset: auto 0 0;
  opacity: 0;
  transition: opacity 240ms ease, clip-path 220ms ease, transform 250ms ease;
}

.entry-folder .icon-active {
  transform: translateY(6%);
  clip-path: inset(15% 0 0);
}

.entry-growth .icon-active { clip-path: inset(0 100% 0 0); }

.entry[data-highlighted] .icon-rest { opacity: 0; }
.entry[data-highlighted] .icon-active {
  opacity: 1;
  clip-path: inset(0);
  transform: none;
}
.entry-growth[data-highlighted] .icon-rest { opacity: 1; }
.entry-growth .icon-active { filter: none; }

.icon-shine {
  position: absolute;
  inset: 0;
  visibility: hidden;
  mask: var(--art) center / 100% 100% no-repeat;
}

.icon-shine::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(110deg, transparent 23%, rgb(255 253 244 / 35%) 38%,
    rgb(255 255 255 / 96%) 50%, rgb(255 255 253 / 36%) 58%, transparent 75%);
}

.entry-caption {
  position: relative;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  display: flex;
  align-items: center;
  gap: .6em;
  margin-top: clamp(8px, 1.45cqw, 22px);
  padding: .46em .94em;
  border-radius: 2em;
  font-size: clamp(13px, 1.37cqw, 21px);
  line-height: 1.34;
  white-space: nowrap;
  transition: color 140ms ease, background-color 140ms ease;
}

.entry-caption i {
  width: .32em;
  height: .32em;
  border: solid currentColor;
  border-width: 1px 1px 0 0;
  transform: rotate(45deg);
}

.entry[data-highlighted] .entry-caption { background: #222; color: #fff; font-weight: 600; }
.entry:focus-visible { outline: none; }
.entry:focus-visible .entry-caption { outline: 2px solid #202020; outline-offset: 3px; }

.portfolio-footer {
  position: absolute;
  z-index: 4;
  inset: auto max(4.63%, env(safe-area-inset-right)) max(5.75%, env(safe-area-inset-bottom)) max(4.63%, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portfolio-signature {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.25cqw, 20px);
}

body:has(.about-dialog[open]) { overflow: hidden; }

.portfolio-signature span { font-size: clamp(13px, 1.12cqw, 17px); font-weight: 600; }

.portfolio-signature button {
  padding: 7px 13px;
  border: 1px solid #dadad7;
  border-radius: 20px;
  background: transparent;
  color: #262625;
  font-weight: 500;
  line-height: 1.3;
  font-family: inherit;
  font-size: clamp(12px, .96cqw, 14px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.portfolio-signature button:hover,
body:has(.about-dialog[open]) #about-button {
  background: #252524;
  border-color: #252524;
  color: #fff;
}

.about-dialog {
  position: fixed;
  inset: auto auto max(10.2svh, calc(env(safe-area-inset-bottom) + 44px))
    max(3.4vw, calc((100vw - 180svh) / 2 + 6.12svh), env(safe-area-inset-left));
  width: min(529px, 92vw);
  max-height: 84svh;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0;
  border: 1px solid #e4e4e1;
  border-radius: 19px;
  background: #fdfdfa;
  color: #20201f;
  box-shadow: 0 16px 52px rgb(26 26 28 / 15%);
}

.about-dialog::backdrop { background: rgb(32 32 32 / 9%); }
.about-card { padding: 27px clamp(22px, 3vw, 36px) 36px; }
.about-card h3 { margin: 0; font-size: 16px; font-weight: 650; }

.about-header,
.about-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.about-header { margin-bottom: 9px; }
.about-header h2 { margin: 0; color: #5b5b58; font-size: 15px; line-height: 1.25; }

.about-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid #e4e4e1;
  border-radius: 50%;
  background: transparent;
  color: #373737;
  font: 400 23px/1 Arial, sans-serif;
  cursor: pointer;
}

.about-close:hover, .contact-action:hover { background: #e9e9e6; }
.about-close:focus-visible, .portfolio-signature button:focus-visible, .contact-action:focus-visible {
  outline: 2px solid #373737;
  outline-offset: 3px;
}

.about-name {
  margin: 0;
  font-size: clamp(34px, 5.4vw, 47px);
  line-height: 1.18;
  letter-spacing: -.05em;
  font-weight: 700;
}

.about-download {
  display: grid;
  align-items: center;
  min-height: 42px;
  flex: none;
  padding: 8px 18px;
  border-radius: 8px;
  background: #222221;
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.about-download:hover { background: #3d3d3b; }

.about-intro {
  margin: 22px 0 23px;
  font-size: 16px;
  line-height: 1.74;
  text-wrap: pretty;
}

.about-experience { padding-top: 20px; border-top: 1px solid #deded9; }
.about-experience dl { margin: 11px 0 19px; }

.about-experience dl > div {
  display: grid;
  grid-template-columns: minmax(82px, 26%) 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.4;
}
.about-experience dl > div + div { border-top: 1px solid #e1e1dd; }
.about-experience dt { font-weight: 650; }
.about-experience dd { margin: 0; color: #535350; }

.about-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 37%);
  gap: 13px 18px;
  padding: 20px;
  border-radius: 12px;
  background: #f0f0ed;
}

.about-contact h3 { grid-column: 1; }
.about-email { grid-column: 1; align-self: start; min-width: 0; }
.contact-label { display: block; margin-bottom: 5px; color: #575753; font-size: 13px; }

#contact-email {
  display: block;
  width: fit-content;
  max-width: 100%;
  font: 14px/1.4 system-ui, sans-serif;
  text-decoration: none;
  overflow-wrap: anywhere;
  user-select: text;
}
#contact-email:hover { text-decoration: underline; text-underline-offset: 3px; }

.contact-action {
  display: inline-grid;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d9d9d5;
  border-radius: 16px;
  background: #fafaf8;
  color: #222;
  font-weight: 400;
  line-height: 1.3;
  font-family: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

#copy-email { margin-top: 12px; }

.about-qr {
  align-self: center;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  margin: 0;
  text-align: center;
}

.about-qr img { display: block; width: 100%; height: auto; background: #fff; }
.about-qr figcaption { margin-top: 6px; color: #545450; font-size: 12px; }
.about-save { display: none; }

.portfolio[data-entrance="prepare"] .entry,
.portfolio[data-entrance="prepare"] .portfolio-title,
.portfolio[data-entrance="prepare"] .portfolio-footer { opacity: 0; }
.portfolio[data-entrance="prepare"] .eye-closed { opacity: 1; }
.portfolio[data-entrance] .entry-icon,
.portfolio[data-entrance] .icon-shine::before { will-change: transform, opacity; }
.portfolio[data-entrance="playing"] .portfolio-title { animation: title-exposure 99ms 6ms both; }
.portfolio[data-entrance="playing"] .entry-icon { animation: icon-flight 270ms 19ms cubic-bezier(.22, .49, .27, 1) both; }
.portfolio[data-entrance="playing"] .icon-shine { visibility: visible; }
.portfolio[data-entrance="playing"] .icon-shine::before { animation: studio-sweep 148ms var(--shine-delay) ease-out both; }
.portfolio[data-entrance="playing"] .entry-caption { animation: fade-in 60ms 208ms both; }
.portfolio[data-entrance="playing"] .portfolio-footer { animation: fade-in 70ms 179ms both; }
.portfolio[data-entrance="playing"] .eye-closed { animation: eyelids-lift 39ms 101ms both; }
.portfolio[data-entrance="playing"] .eye-slit { animation: eyes-in-between 96ms 101ms both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes title-exposure {
  0% { opacity: 0; }
  38% { opacity: .72; }
  58% { opacity: .58; }
  100% { opacity: 1; }
}
@keyframes icon-flight {
  from {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) scale(.64);
  }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes studio-sweep {
  0% { opacity: 0; transform: translate3d(-84%, 0, 0); }
  26% { opacity: .95; }
  73% { opacity: .92; }
  100% { opacity: 0; transform: translate3d(84%, 0, 0); }
}
@keyframes eyelids-lift { from { opacity: 1; } to { opacity: 0; } }
@keyframes eyes-in-between {
  0% { opacity: 0; }
  41% { opacity: 1; }
  100% { opacity: 0; }
}

@media (orientation: portrait) {
  .portfolio-scene {
    width: min(100%, 74svh);
    height: 100svh;
    min-height: 540px;
  }
  .portfolio-title { top: max(9.5%, calc(env(safe-area-inset-top) + 22px)); }
  .avatar { top: 23%; width: 50%; left: 48.8%; }
  .entry-folder {
    --x: 17.75%;
    --y: 43.5%;
    --width: 23%;
    --from-x: 30cqw;
    --from-y: -2svh;
  }
  .entry-player {
    --x: 82.75%;
    --y: 26.5%;
    --width: 25%;
    --from-x: -28cqw;
    --from-y: 9svh;
  }
  .entry-growth {
    --x: 82.25%;
    --y: 57%;
    --width: 21%;
    --from-x: -25cqw;
    --from-y: -14svh;
  }
  .entry { --icon-shadow: drop-shadow(2px 7px 10px rgb(40 40 44 / 16%)); }
  .entry-caption { font-size: clamp(11px, 3.12cqw, 16px); padding-inline: .62em; }
  .entry-folder .entry-caption { left: calc(50% - 3px); }
  .entry-growth .entry-caption { left: calc(50% + 3px); gap: .38em; padding-inline: .43em; }
  .portfolio-footer { inset-block-end: max(4.25%, env(safe-area-inset-bottom)); }
  .about-dialog {
    inset: auto 0 0;
    width: min(100%, 540px);
    max-width: none;
    max-height: calc(100dvh - max(25px, env(safe-area-inset-top)));
    margin-inline: auto;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
  }
  .about-card { padding: 15px clamp(16px, 6.15vw, 26px) max(33px, env(safe-area-inset-bottom)); }
  .about-card::before {
    display: block;
    width: 36px;
    height: 2px;
    margin: 0 auto 13px;
    border-radius: 4px;
    background: #c9c9c2;
    content: "";
  }
  .about-header h2 { font-size: 13px; }
  .about-download { min-height: 38px; padding-inline: 13px; font-size: 13px; }
  .about-intro { margin: 17px 0 18px; font-size: 14px; line-height: 1.65; }
  .about-experience { padding-top: 15px; }
  .about-card h3 { font-size: 14px; }
  .about-experience dl { margin: 6px 0 16px; }
  .about-experience dl > div { grid-template-columns: minmax(66px, 24%) 1fr; padding: 8px 0; font-size: 12.5px; }
  .about-contact { grid-template-columns: minmax(0, 1fr) min(42%, 127px); gap: 12px 8px; padding: 14px; }
  .about-contact h3, .about-email { grid-column: 1 / -1; }
  .about-email {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 7px;
    padding-bottom: 13px;
    border-bottom: 1px solid #d9d9d5;
  }
  .about-email .contact-label { grid-column: 1; margin-bottom: 3px; }
  #contact-email { grid-column: 1; font-size: 12px; }
  #copy-email { margin-top: 0; grid-column: 2; grid-row: 1 / span 2; }
  .about-qr { grid-column: 2; grid-row: 3; }
  .about-qr figcaption { display: none; }
  .about-save { display: grid; grid-column: 1; grid-row: 3; align-content: center; justify-items: start; gap: 8px; }
  .about-save > span { font-size: 14px; font-weight: 650; }
  .about-save p { margin: 0; font-size: 12px; color: #575753; }
}

@media (max-width: 340px) and (orientation: portrait) {
  .entry-folder { --x: 19%; }
  .entry-growth { --x: 79%; }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio *, .portfolio *::before, .portfolio *::after {
    animation: none !important;
    transition: none !important;
  }
}
