.portfolio-page {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

.portfolio-hero {
  --grid-left: 8.83333%;
  --grid-tilt: 34deg;
  --archive-inset: 100px;
  position: sticky;
  top: 0;
  z-index: 1;
  width: min(100%, var(--stage-width));
  height: 100vh;
  min-height: 500px;
  margin-inline: auto;
  overflow: hidden;
  opacity: var(--hero-opacity, 1);
  transform: scale(var(--hero-scale, 1));
}
.hero-grid-plane {
  position: absolute;
  inset: calc(50% - 256px) auto auto var(--grid-left);
  width: var(--grid-width, 120%);
  height: 512px;
  transform: perspective(1200px) rotateY(var(--grid-tilt));
  background-image: radial-gradient(circle, rgb(255 255 255 / .15) 2px, transparent 2.75px);
  background-size: 40px 40px;
  animation: grid-enter 1s var(--float) both, grid-drift .8s linear infinite;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 71%, transparent 96%);
}
@keyframes grid-enter {
  from {
    opacity: 0;
    transform: perspective(1200px) translateX(300px) scale(.5) rotateY(var(--grid-tilt));
  }
}
@keyframes grid-drift { to { background-position: -40px 0; } }

.hero-design {
  position: absolute;
  top: 50%;
  left: 76%;
  width: 19%;
  aspect-ratio: 1.76154;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(3, 29%);
  grid-template-areas: "d s g" "e i n";
  justify-content: space-between;
  align-content: space-between;
}
.hero-design img {
  width: 100%;
  animation: design-enter 1s var(--float) var(--delay) both;
}
.design-d { grid-area: d; --delay: .5s; }
.design-e { grid-area: e; --delay: .6s; }
.design-s { grid-area: s; --delay: .7s; }
.design-i { grid-area: i; --delay: .8s; }
.design-g { grid-area: g; --delay: .8s; }
.design-n { grid-area: n; --delay: .9s; }
@keyframes design-enter { from { opacity: 0; transform: translateX(150px); } }

.hero-archive {
  position: absolute;
  right: var(--archive-inset);
  bottom: 75px;
  animation: archive-enter 1s var(--float) 1s both;
}
.hero-archive img {
  animation: hand-down 2.4s var(--float) infinite alternate;
}
@keyframes archive-enter { from { opacity: 0; transform: translateY(-200px); } }
@keyframes hand-down { to { transform: translateY(12px); } }

.project-hint {
  position: relative;
  justify-self: end;
  width: var(--hint-width);
  aspect-ratio: var(--hint-ratio, 1.5);
}
.project-hint img {
  width: 100%;
  height: 100%;
}
.project-hint span {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  width: max-content;
  transform: translateY(-50%);
  font-size: var(--hint-font);
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}
.pointer-cue-content {
  position: relative;
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .pointer-cue-content {
    animation: pointer-cue-drift 2s var(--float) infinite alternate paused;
  }
  .pointer-cue.is-in-view:not(.project:not(.is-visible) *) > .pointer-cue-content {
    animation-play-state: running;
  }
  .pointer-cues-ready .pointer-cue-content,
  .pointer-cues-ready .pointer-cue-content > span {
    transition: opacity 1s var(--float), translate 1s var(--float);
  }
  .pointer-cues-ready .pointer-cue:is(:not(.is-half-visible), .project:not(.is-visible) *) > .pointer-cue-content {
    opacity: var(--cue-entry-opacity, 1);
    translate: var(--cue-entry-offset, none);
  }
  .pointer-cues-ready .pointer-cue:is(:not(.is-in-view), .project:not(.is-visible) *) .pointer-cue-content > span {
    opacity: 0;
    translate: var(--cue-label-entry, 30px 0);
  }
}
@keyframes pointer-cue-drift { to { transform: translate(var(--cue-x, 20px), var(--cue-y, 0px)); } }
@media (width >= 600px) {
  .project-hint {
    --cue-entry-opacity: 0;
    --cue-entry-offset: 150px 0;
  }
}

.portfolio-page .site-footer {
  width: min(100%, var(--stage-width));
  margin: 0 auto;
}
.portfolio-page .footer-mark {
  display: flex;
  right: var(--footer-inset);
}

@media (900px <= width < 1200px) {
  .portfolio-hero {
    --grid-left: 3.33333%;
    --archive-inset: 50px;
  }
}

@media (600px <= width < 900px) {
  .portfolio-hero {
    --grid-left: -1.33334%;
    --archive-inset: 50px;
  }
  .hero-design { left: auto; right: 80px; transform: translateY(-50%); }
}

@media (width < 600px) {
  .portfolio-hero {
    --grid-width: 160%;
    --grid-left: -21.5625%;
    --grid-tilt: 54deg;
    --archive-inset: 30px;
    position: relative;
    height: 95vh;
  }
  .hero-design {
    left: auto;
    right: 30px;
    width: 8%;
    aspect-ratio: .158031;
    transform: translateY(-50%);
    grid-template-columns: 1fr;
    grid-template-areas: "g" "n" "s" "i" "d" "e";
  }
  .hero-archive { bottom: 100px; }
  .project-hint {
    --cue-label-entry: 0 -20px;
    justify-self: center;
  }
  .project-hint span {
    top: calc(100% + 10px);
    right: auto;
    left: 0;
    transform: none;
    text-align: left;
  }
  .portfolio-page .footer-mark { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-hero { position: relative; }
  .hero-grid-plane, .hero-design img, .hero-archive, .hero-archive img {
    animation: none;
  }
}
