/* Scoped hero integration. Existing typography and the later sections are retained. */
.welcome-shell .hero-grid{
  position:relative;isolation:isolate;padding-bottom:0;align-items:center;min-width:0;
}
.hero-grid .hero-copy{position:relative;z-index:2;padding-bottom:92px}
.integrated-hero-visual{
  position:relative;z-index:1;align-self:end;min-width:0;width:100%;aspect-ratio:4/3;
  margin:0;overflow:hidden;background:var(--paper);
}
.integrated-hero-visual>video,.integrated-hero-visual>img{
  position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;
}
.integrated-hero-visual>video{opacity:0}
.integrated-hero-visual>video.has-frame{opacity:1}
.hero-replay{position:absolute;inset:0;z-index:3;width:100%;height:100%;padding:0;border:0;border-radius:0;background:transparent;cursor:pointer;touch-action:manipulation}
.hero-replay:focus-visible{outline:3px solid var(--green);outline-offset:-4px}
/* Only the later scenes dissolve into paper. The landing stays fully grounded. */
.integrated-hero-visual::after{
  content:"";position:absolute;z-index:2;pointer-events:none;inset:auto 0 0;height:14%;
  background:linear-gradient(to bottom,rgba(245,241,235,0) 40%,var(--paper) 100%);
  opacity:var(--hero-separation,0);
}
.hero-road{
  position:absolute;z-index:0;bottom:0;left:50%;width:100vw;height:41px;
  transform:translateX(-50%);pointer-events:none;
}
.hero-road svg{display:block;width:100%;height:100%;overflow:hidden}
.welcome-shell .steps-section::before{
  top:0;-webkit-mask:none;mask:none;
}
.welcome-shell .steps-section::after{
  content:"";position:absolute;z-index:-1;pointer-events:none;top:0;left:50%;
  width:100vw;height:clamp(40px,5vw,68px);transform:translateX(-50%);
  background:linear-gradient(to bottom,var(--paper),rgba(245,241,235,0));
  opacity:var(--hero-separation,0);
}
.hero-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:820px){
  .welcome-shell .hero-grid{padding-bottom:0;gap:20px;grid-template-columns:minmax(0,1fr)}
  .hero-grid .hero-copy{padding-bottom:0}
  /* The video stays inside the content column; only the decorative road spans the page. */
  .integrated-hero-visual{width:100%;max-width:100%;justify-self:stretch}
  .hero-road{height:calc((100vw - 32px) * .06428592)}
}

/* The larger decorative pin appears after playback; replay remains above it. */
.hero-pin-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transform-origin: 53.5% 46.55%;
}
.integrated-hero-visual .hero-pin {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.integrated-hero-visual .hero-pin[hidden] { display: none !important; }
.integrated-hero-visual .hero-pin.is-ending {
  animation: hero-pin-ending-reveal 450ms cubic-bezier(.333333, 0, .666667, 1) both;
}
@keyframes hero-pin-ending-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .integrated-hero-visual .hero-pin.is-ending { animation: none; }
}

#hero-nudge-target {
  position: absolute;
  inset: 20% 0 3%;
  pointer-events: none;
}
/* During the cue, restore the ground and draw the moving objects in their original stacking order. */
.hero-nudge {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-nudge span {
  position: absolute;
  background-image: var(--hero-nudge-sprite);
  background-repeat: no-repeat;
}
/* Scene positions use the 1200 × 900 still. Sprite positions use the 1232 × 1064 atlas. */
.hero-nudge-repair {
  inset: 45.777778% auto auto 9.666667%;
  width: 87.666667%;
  height: 52%;
  background-size: 117.110266% 227.350427%;
}
.hero-nudge-rear-bag {
  inset: 56.888889% auto auto 57%;
  width: 31%;
  height: 38.666667%;
  background-size: 331.182796% 305.747126%;
  background-position: 55.348837% 65.921788%;
  transform-origin: center 95%;
  --tilt-peak: translate(1.07527%, -.57471%) rotate(1.15deg);
  --tilt-return: translate(-.21505%, 0) rotate(-.23deg);
  animation: hero-nudge-gentle 825ms ease-in-out 40ms both;
}
.hero-nudge-front-bag {
  inset: 45.777778% auto auto 36.666667%;
  width: 39.333333%;
  height: 49.333333%;
  background-size: 261.016949% 239.639640%;
  background-position: left 76.129032%;
  transform-origin: center 95%;
  --tilt-peak: translate(-.84746%, -.67568%) rotate(-1.25deg);
  --tilt-return: translate(.16949%, 0) rotate(.25deg);
  animation: hero-nudge-gentle 825ms ease-in-out 65ms both;
}
.hero-nudge-box {
  inset: 68.888889% auto auto 9.666667%;
  width: 35%;
  height: 26.222222%;
  background-size: 293.333333% 450.847458%;
  background-position: 58.62069% bottom;
  transform-origin: center 92%;
  --tilt-peak: translate(-1.19048%, -.74153%) rotate(-1.4deg);
  --tilt-return: translate(.23810%, 0) rotate(.28deg);
  animation: hero-nudge-gentle 825ms ease-in-out 125ms both;
}
.hero-nudge-bottle {
  left: 24.666667%;
  top: 80.888889%;
  width: 22%;
  height: 16.888889%;
  background-size: 466.666667% 700%;
  background-position: 92.975207% 90.350877%;
  transform-origin: center 88%;
  animation: hero-nudge-bottle 850ms ease-in-out both;
}
.hero-nudge-takeout-box {
  left: 64.25%;
  top: 81.888889%;
  width: 20.75%;
  height: 13.222222%;
  background-size: 494.779116% 894.117647%;
  background-position: 86.673449% 49.94709%;
  transform-origin: center 90%;
  --tilt-peak: translate(-1.2%, -1.1%) rotate(-1.4deg);
  --tilt-return: translate(.24%, 0) rotate(.28deg);
  animation: hero-nudge-gentle 825ms ease-in-out 85ms both;
}
.hero-nudge-takeout-tub {
  left: 81.083333%;
  top: 78.777778%;
  width: 15.5%;
  height: 17.888889%;
  background-size: 662.365591% 660.869565%;
  background-position: 81.453155% 66.002215%;
  transform-origin: center 90%;
  --tilt-peak: translate(2.1%, -1.25%) rotate(2.2deg);
  --tilt-return: translate(-.42%, 0) rotate(-.44deg);
  animation: hero-nudge-gentle 825ms ease-in-out 95ms both;
}
.hero-nudge-takeout-lid {
  left: 74.25%;
  top: 91%;
  width: 11.5%;
  height: 6.555556%;
  background-size: 892.753623% 1803.389831%;
  background-position: 95.612431% 59.303483%;
  transform-origin: center 88%;
  /* This last movement ends the cue. */
  animation: hero-nudge-lid 850ms ease-in-out 100ms both;
}
.hero-nudge:not([hidden]) + .hero-pin-motion {
  --tilt-peak: translateY(-.5%) rotate(1.2deg);
  --tilt-return: translateY(.1%) rotate(-.24deg);
  animation: hero-nudge-gentle 825ms ease-in-out 85ms both;
}
@keyframes hero-nudge-gentle {
  38%, 48% { transform: var(--tilt-peak); }
  75% { transform: var(--tilt-return); }
}
@keyframes hero-nudge-bottle {
  35%, 45% { transform: translate(-3.2%, -1.3%) rotate(-4.2deg); }
  76% { transform: translate(.65%, 0) rotate(1deg); }
}
@keyframes hero-nudge-lid {
  38%, 48% { transform: translate(2.5%, -1.1%) rotate(3.4deg); }
  78% { transform: translate(-.45%, 0) rotate(-.8deg); }
}
