.hero.hero-story {
  grid-template-areas: "intro stage" "profile stage";
  align-items: start;
  row-gap: 0;
  padding-block: 0;
}

.hero-beat,
.hero-stage {
  display: grid;
  align-content: center;
  min-height: clamp(490px, calc(100svh - 74px), 940px);
}

.hero-introduction { grid-area: intro; }
.hero-profile { grid-area: profile; scroll-margin-top: clamp(14px, 6svh, 56px); }

.hero-stage {
  grid-area: stage;
  position: sticky;
  top: 0;
  min-width: 0;
}

.hero-introduction h1 { max-width: 9ch; }
.hero-introduction .hero-greeting {
  margin-bottom: .5em;
  color: var(--muted);
  font-size: .38em;
  letter-spacing: -.05em;
}
.hero-introduction .hero-period { display: inline; }
.hero-story .hero-role { margin-block: 25px 0; }

.hero-scroll-link {
  justify-self: start;
  gap: 10px;
  margin-top: 19px;
}

.hero-scroll-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-text);
}

.hero-profile h2 { font-size: clamp(50px, 6.4vw, 96px); }
.hero-profile h2 > span { display: block; }
.portrait-lean { isolation: isolate; transition: transform 165ms ease-out; }
.portrait-focused { mix-blend-mode: plus-lighter; }
.desk-keybeat { opacity: 0; }
.desk-keybeat--right { --desk-key-delay: .17s; }
.desk-finger-press {
  --desk-key-lift: rotate(-5.5deg);
  transform-origin: 694px 744px;
}
.desk-finger-press.desk-keybeat--right {
  --desk-key-lift: rotate(-5deg);
  transform-origin: 838px 724px;
}
.desk-reflection-pulse {
  --desk-key-rest: .02;
  --desk-key-hit: .59;
  mix-blend-mode: screen;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-portrait[data-typing] .desk-keybeat {
    animation: desk-keybeat 2.75s ease-in-out var(--desk-key-delay, 0s) 3;
  }

  .hero-portrait[data-typing] .desk-reflection-pulse {
    animation-name: desk-reflection;
  }
}

@keyframes desk-keybeat {
  0%, 100% { transform: none; opacity: 0; }
  5%, 21%, 38%, 54%, 77% {
    transform: var(--desk-key-lift, none);
    opacity: var(--desk-key-rest, 1);
  }
  11%, 29%, 47%, 63% {
    transform: none;
    opacity: var(--desk-key-hit, 1);
  }
}

/* Reflections peak on each keypress and fade more slowly than the finger lifts. */
@keyframes desk-reflection {
  0%, 100% { opacity: 0; }
  5%, 25%, 43%, 59%, 96% { opacity: var(--desk-key-rest); }
  11%, 16%, 29%, 34%, 47%, 52%, 63%, 69% { opacity: var(--desk-key-hit); }
}

.portrait-return-hint { display: none; }
.hero-portrait[data-pose="desk"] :is(.portrait-mouse-hint, .portrait-touch-hint) { display: none; }
.hero-portrait[data-pose="desk"] .portrait-return-hint { display: inline; }

@media (max-width: 760px) {
  .hero.hero-story {
    --portrait-height: min(calc((100vw - 36px) * .7794), 42svh, 429px);
    display: block;
  }

  .hero-introduction {
    min-height: clamp(242px, calc(51svh - 87px), 357px);
    padding-block: 27px 18px;
  }

  .hero-introduction h1 { max-width: 13ch; }
  .hero-story .hero-role { margin-top: 17px; }
  .hero-scroll-link { margin-top: 8px; }

  .hero-stage {
    z-index: 1;
    min-height: auto;
    padding-block: 8px;
    background: var(--paper);
  }

  .hero-portrait { width: min(100%, 54svh, 550px); margin-inline: auto; }

  .hero-profile {
    min-height: max(340px, calc(100svh - var(--portrait-height) - 32px));
    padding-block: 26px 44px;
    scroll-margin-top: calc(var(--portrait-height) + 25px);
  }

  .hero-profile h2 { font-size: clamp(43px, 9vw, 65px); }
}

