.opening {
  position: relative;
  display: grid;
  place-items: center;
  min-height: max(320px, calc(100vh - var(--nav-height)));
  min-height: max(320px, calc(100svh - var(--nav-height)));
  padding: 24px 0 calc(24px + var(--nav-height));
  overflow: clip;
  background: var(--site-bg);
  color: var(--site-fg);
}
.opening > noscript { position: absolute; }
.opening-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--site-muted);
  font: inherit;
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.opening-play:focus-visible { outline: none; }
.opening-play:focus-visible + .opening-stage .opening-focus-ring {
  stroke: currentColor;
}
.opening-stage {
  position: relative;
  /* The visible ink fills about 83% of the character's square viewBox. */
  --figure: 5.6em;
  --speech-gap: .55em;
  display: flex;
  align-items: flex-start;
  gap: var(--speech-gap);
  width: max-content;
  max-width: calc(100% - 2 * var(--page-gutter));
  font-size: clamp(1.1875rem, calc(.9rem + 1.35vw), 2rem);
}
.opening-character {
  display: block;
  flex: none;
  width: var(--figure);
  height: var(--figure);
  overflow: visible;
  transform-origin: var(--figure-center-x, 50%) 50%;
}
.opening[data-phase="catching"] .opening-character {
  transform: scale(calc(1 + (var(--solo-scale, 1.7) - 1) * var(--closeup-progress, 0)));
}
.opening[data-phase="settled"] .opening-character {
  transform: scale(var(--solo-scale, 1.7));
}
@media (max-width: 600px) {
  .opening { --solo-scale: 1.5; }
}
@media (max-height: 520px) {
  .opening { --solo-scale: 1.3; }
}
.opening-speech {
  position: relative;
  display: grid;
  align-items: start;
  min-width: 0;
  /* The eyes in the resting pose look a little above horizontal. */
  margin-top: calc(var(--figure) * .42 - .69em);
  color: #191919;
  line-height: 1.44;
  letter-spacing: normal;
}
.opening-speech p { margin: 0; }
.opening-speech [data-line] > span { display: inline-block; }
.opening-period, .period-baseline { display: inline-block; }
.period-baseline { width: 0; height: 0; vertical-align: baseline; }
.opening[data-phase="catching"] [data-gesture]:not([data-gesture="blink"]) {
  opacity: var(--farewell-opacity, 1);
}
.has-pen [data-line] {
  grid-area: 1 / 1;
  visibility: hidden;
  line-break: strict;
}
.opening[data-speech="hello"] [data-line="hello"] {
  visibility: visible;
}
.typing-output {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.typing-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: max(1px, .06em);
  height: .88em;
  background: currentColor;
}
@media (prefers-reduced-motion: no-preference) {
  .topbar[data-opening-overlap] { background: var(--site-bg); }
  .opening-stage { translate: 0 var(--scroll-drift, 0px); }
  .profile-accent { translate: 0 var(--accent-drift, 0px); }
  /* A blank stage until the deferred choreography is ready; the header is separate. */
  .opening-loading .opening-stage { visibility: hidden; }
}
