.hero .goal-pill {
  position: relative;
  isolation: isolate;
  overflow: visible;
  background: transparent;
  line-height: 0;
  white-space: nowrap;
}

.hero-goal-line {
  display: inline-flex;
  align-items: baseline;
  column-gap: .25em;
  width: max-content;
  white-space: nowrap;
  font-size: calc(1em * var(--hero-goal-scale, 1));
}

.hero-goal-line > .goal-pill { flex: none; }

.hero-goal-copy {
  position: relative;
  flex: none;
  display: inline-grid;
  grid-template-areas: "word";
  overflow: visible;
  vertical-align: baseline;
  white-space: nowrap;
  text-align: left;
  /* The 1.06x pill overhangs its reserved width by .033em on each side. */
  margin-inline-start: .033em;
}

.hero-goal-copy > span { grid-area: word; }
.hero-goal-measure {
  /* Hidden probes must not widen the current phrase's scrollable overflow. */
  position: fixed;
  top: 0;
  left: 0;
  width: max-content;
  visibility: hidden;
  pointer-events: none;
}

.hero-goal-word {
  display: inline-block;
  justify-self: start;
  width: max-content;
  text-box-trim: none;
  overflow: visible;
}

.hero-goal-visual {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: translateY(2px) scale(1.06);
  transform-origin: 50% 100%;
}

.hero-goal-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 260%;
  height: 260%;
  max-width: none;
  transform: translate(-50%, -50%) scale(var(--hero-hover-scale, 1));
  transform-origin: 50% 69.230769%;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
  opacity: 0;
  pointer-events: none;
}

.hero-goal-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: #f7f7f7;
  box-shadow: inset 0 0 0 .5px rgba(21, 17, 13, .45);
  transform: scale(var(--hero-hover-scale, 1));
  transform-origin: 50% 100%;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.hero-goal-fallback img {
  display: block;
  width: 29.37%;
  height: 54.61%;
  object-fit: contain;
}

.hero-goal-button {
  position: absolute;
  z-index: 1;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.hero-goal-button:focus-visible {
  outline: 2px solid rgba(21, 17, 13, .55);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .hero-goal-visual:has(.hero-goal-button:is(:hover, :focus-visible):not(:disabled)) {
    --hero-hover-scale: 1.04;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-goal-canvas,
  .hero-goal-fallback { transition: none; }
}

.goal-pill[data-renderer="three"] .hero-goal-canvas { opacity: 1; }
.goal-pill[data-renderer="three"] .hero-goal-fallback { visibility: hidden; }

/* The title keeps its inline footprint while the same canvas settles in the preview. */
.hero[data-pill-flight="true"] { z-index: 3; }
.hero[data-pill-flight="true"] .goal-pill { z-index: 2; }
.workspace-window::after {
  content: "";
  position: absolute;
  left: var(--hero-dock-x, 50%);
  top: calc(var(--hero-dock-y, 68px) + var(--hero-dock-width, 176px) * .25 - 2px);
  width: calc(var(--hero-dock-width, 176px) * .72);
  height: calc(var(--hero-dock-width, 176px) * .045);
  border-radius: 50%;
  background: #15110d;
  filter: blur(5px);
  opacity: var(--hero-dock-shadow, 0);
  transform: translateX(-50%);
  pointer-events: none;
}
