/* scout: the Pea packs card (Home, straight after the levels). The Scout pack,
   coming soon: Pea in Scout's trench coat and fedora breaks out of a light brass
   card, with JJ's Scout line, the round private eye badge and a Coming soon stamp.
   On view (about 6 s): Pea hops in, a glint crosses the magnifier, the badge spins
   in, the stamp lands, then Pea peeks through the glass and back.
   States: the markup rests on the last beat (no script needed); scout.js sets the
   first frame before it scrolls into view (.is-wait hides each piece until
   its beat); .is-gentle softens the moves under
   reduced motion (it still plays). */

.anim-scout { --sc-pad: clamp(28px, 3.8vw, 44px); --sc-break: clamp(64px, 8vw, 96px); }
.anim-scout .sc-card { position: relative; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; column-gap: clamp(20px, 3.4vw, 44px); max-width: 960px; margin: calc(var(--sc-break) + 24px) auto 0; padding: var(--sc-pad) clamp(28px, 4.6vw, 60px) var(--sc-pad) clamp(18px, 2.6vw, 34px); border: 1px solid #e2c891; border-radius: var(--r-lg); background: linear-gradient(160deg, var(--brass-soft), var(--card) 70%); box-shadow: var(--shadow); text-align: left; }
.anim-scout .sc-card.is-thud { animation: scout-thud .32s ease-out; }

/* ---------- The picture, breaking out of the card's top edge ---------- */
.anim-scout .sc-pic { position: relative; align-self: stretch; min-height: 250px; }
/* The picture grows with the card, so it always stands on the card's floor and
   always breaks out of its top edge by --sc-break. */
.anim-scout .sc-peek { position: absolute; left: 50%; bottom: calc(6px - var(--sc-pad)); display: block; height: calc(100% + var(--sc-pad) - 6px + var(--sc-break)); max-height: 470px; margin: 0; padding: 0; border: 0; border-radius: 24px; background: none; cursor: pointer; transform: translateX(-50%); -webkit-tap-highlight-color: transparent; }
.anim-scout .sc-peek:focus-visible { outline: 3px solid var(--brass); outline-offset: 4px; }
.anim-scout .sc-rig { position: relative; display: block; height: 100%; aspect-ratio: 662 / 820; transform-origin: 50% 100%; }
.anim-scout .sc-body { position: absolute; inset: 0; transform-origin: 50% 100%; }
.anim-scout .sc-pose { position: absolute; left: 54%; bottom: 0; height: 100%; translate: calc(var(--cx) * -100%) 0; pointer-events: none; user-select: none; }
.anim-scout .sc-pose img { display: block; width: auto; height: 100%; max-width: none; filter: drop-shadow(0 22px 22px rgba(70, 46, 26, .28)); }
.anim-scout .sc-pose--stand { --cx: .54; aspect-ratio: 662 / 820; }
.anim-scout .sc-pose--peek { --cx: .5; aspect-ratio: 634 / 820; opacity: 0; }
.anim-scout .sc-pic.is-peek .sc-pose--stand { opacity: 0; }
.anim-scout .sc-pic.is-peek .sc-pose--peek { opacity: 1; }
.anim-scout .sc-body.is-squash { animation: scout-squash .42s cubic-bezier(.3, 1.4, .5, 1); }

/* The glint across the lens (the glass sits at these spots in scout.webp) */
.anim-scout .sc-glint { position: absolute; left: 2.3%; top: 22.6%; width: 12.6%; height: 15%; border-radius: 50%; overflow: hidden; rotate: 9deg; pointer-events: none; }
.anim-scout .sc-glint::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, rgba(255, 255, 255, .2) 70%); opacity: 0; }
.anim-scout .sc-glint b { position: absolute; top: -30%; left: 0; width: 34%; height: 160%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 35%, #fff 65%, rgba(255, 255, 255, 0)); box-shadow: 18px 0 0 -6px rgba(255, 255, 255, .85); transform: translateX(-160%) rotate(22deg); }
.anim-scout .sc-glint.is-on::before { animation: scout-flash .9s ease-out both; }
.anim-scout .sc-glint.is-on b { animation: scout-glint .8s cubic-bezier(.45, 0, .2, 1) both; }
.anim-scout .sc-twinkle { position: absolute; left: 12.4%; top: 19.6%; width: 7%; aspect-ratio: 1; background: #fff; opacity: 0; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); filter: drop-shadow(0 0 3px rgba(255, 214, 110, .9)); }
.anim-scout .sc-twinkle.is-on { animation: scout-twinkle .7s ease-out both; }

/* ---------- The words ---------- */
.anim-scout .sc-words { min-width: 0; padding-block: 6px; }
.anim-scout .sc-head { display: flex; align-items: center; gap: 16px; }
.anim-scout .sc-title { font: 800 clamp(42px, 5vw, 58px)/.95 var(--display); letter-spacing: -.045em; color: var(--ink); }
.anim-scout .sc-badge { flex: none; display: block; width: clamp(76px, 8vw, 96px); aspect-ratio: 1; filter: drop-shadow(0 8px 10px rgba(138, 101, 38, .3)); }
.anim-scout .sc-badge svg { display: block; width: 100%; height: 100%; overflow: visible; }
.anim-scout .sc-badge__face { fill: var(--brass-soft); }
/* stitching on the brass ring; the lettering sits inside the face, clear of it */
.anim-scout .sc-badge__dash { fill: none; stroke: var(--brass-soft); stroke-width: 1.1; stroke-dasharray: 2 2.6; opacity: .8; }
.anim-scout .sc-badge__txt { font: 800 11px/1 var(--body); letter-spacing: 1px; fill: var(--brass); }
.anim-scout .sc-badge__lens { fill: #fff; stroke: var(--brass); stroke-width: 4; }
.anim-scout .sc-badge__shine { fill: none; stroke: var(--brass-soft); stroke-width: 2.4; stroke-linecap: round; }
.anim-scout .sc-badge__handle { fill: none; stroke: var(--brass); stroke-width: 6; stroke-linecap: round; }
.anim-scout .sc-badge__star { fill: var(--brass); opacity: .8; }
.anim-scout .sc-badge.is-in { animation: scout-spin .85s cubic-bezier(.3, 1.35, .5, 1) both; }
.anim-scout .sc-line { margin-top: 18px; max-width: 34em; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.anim-scout .sc-fine { margin-top: 14px; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* ---------- The stamp ---------- */
.anim-scout .sc-stamp { position: absolute; z-index: 3; top: clamp(16px, 2.4vw, 26px); right: clamp(16px, 2.4vw, 28px); padding: 9px 13px 8px; border: 3px solid var(--brass); border-radius: 10px; color: var(--brass); font: 800 15px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; rotate: 8deg; box-shadow: inset 0 0 0 2px var(--brass-soft), inset 0 0 0 3.5px rgba(138, 101, 38, .55); background: rgba(251, 252, 248, .55); opacity: .92; }
.anim-scout .sc-stamp.is-in { animation: scout-stamp .5s cubic-bezier(.2, .9, .3, 1.25) both; }

/* ---------- Controls ---------- */
.anim-scout .sc-ctl { position: relative; justify-content: center; align-items: center; min-height: 44px; margin-top: 22px; }
.anim-scout .sc-ctl button { white-space: nowrap; }

.anim-scout .sc-again { visibility: hidden; }
/* Before the first play ends, the hidden Watch again leaves the row, so "Watch
   with sound" sits centred on its own. After that it keeps its place, so a
   replay never shifts the row. */
.anim-scout:not(.was-played) .sc-again { position: absolute; pointer-events: none; }
.anim-scout.has-played .sc-again { visibility: visible; animation: scout-rise .4s ease both; }

/* ---------- First frame and the moves ---------- */
.anim-scout .is-wait { opacity: 0; }
.anim-scout .sc-rig.is-in { animation: scout-in .8s cubic-bezier(.3, 1.3, .5, 1) both; }

@keyframes scout-in {
  0% { opacity: 0; transform: translateY(16%) scale(.96, 1.04); }
  38% { opacity: 1; transform: translateY(-5%) scale(.97, 1.03); }
  64% { transform: translateY(0) scale(1.04, .96); }
  82% { transform: scale(.99, 1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes scout-squash { 0% { transform: scale(1.04, .96); } 45% { transform: scale(.98, 1.02); } 100% { transform: none; } }
@keyframes scout-glint { from { transform: translateX(-160%) rotate(22deg); } to { transform: translateX(360%) rotate(22deg); } }
@keyframes scout-flash { 0% { opacity: 0; } 35% { opacity: .55; } 100% { opacity: 0; } }
@keyframes scout-twinkle { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.2) rotate(40deg); } 100% { opacity: 0; transform: scale(.3) rotate(90deg); } }
@keyframes scout-spin { 0% { opacity: 0; transform: rotate(-240deg) scale(.2); } 60% { opacity: 1; transform: rotate(12deg) scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes scout-stamp { 0% { opacity: 0; transform: scale(1.9); } 60% { opacity: .92; transform: scale(.94); } 100% { opacity: .92; transform: none; } }
@keyframes scout-thud { 0%, 100% { transform: none; } 35% { transform: translateY(2px) scale(.997); } }
@keyframes scout-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Gentler moves under reduced motion */
.anim-scout.is-gentle .sc-rig.is-in { animation-name: scout-in-g; animation-timing-function: ease-out; }
.anim-scout.is-gentle .sc-badge.is-in { animation-name: scout-spin-g; animation-timing-function: ease-out; }
.anim-scout.is-gentle .sc-stamp.is-in { animation-name: scout-stamp-g; animation-timing-function: ease-out; }
.anim-scout.is-gentle .sc-card.is-thud, .anim-scout.is-gentle .sc-body.is-squash { animation: none; }
@keyframes scout-in-g { from { opacity: 0; transform: translateY(3%); } to { opacity: 1; transform: none; } }
@keyframes scout-spin-g { from { opacity: 0; transform: rotate(-30deg) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes scout-stamp-g { from { opacity: 0; transform: scale(1.12); } to { opacity: .92; transform: none; } }

/* ---------- Narrow two columns: keep the peeking hand clear of the words ---------- */
@media (min-width: 721px) and (max-width: 820px) {
  .anim-scout .sc-card { column-gap: 34px; }
  .anim-scout .sc-peek { left: 46%; }
}

/* ---------- Phone: stacked, picture first ---------- */
@media (max-width: 720px) {
  .anim-scout { --sc-h: 232px; --sc-pad: 22px; --sc-break: 74px; }
  .anim-scout .sc-card { grid-template-columns: minmax(0, 1fr); margin-top: calc(var(--sc-break) + 20px); padding: 0 20px 24px; }
  .anim-scout .sc-pic { min-height: 0; height: calc(var(--sc-h) - var(--sc-break)); }
  .anim-scout .sc-peek { left: -6px; bottom: 0; height: var(--sc-h); transform: none; }
  .anim-scout .sc-words { padding-top: 10px; }
  .anim-scout .sc-head { gap: 14px; }
  .anim-scout .sc-title { font-size: 44px; }
  .anim-scout .sc-badge { width: 74px; }
  .anim-scout .sc-line { margin-top: 14px; font-size: 18px; }
  .anim-scout .sc-stamp { top: 44px; right: 12px; padding: 7px 9px 6px; border-width: 2.5px; font-size: 12.5px; letter-spacing: .1em; rotate: 10deg; }
}
@media (max-width: 380px) {
  .anim-scout { --sc-h: 214px; --sc-break: 68px; }
  .anim-scout .sc-stamp { top: 40px; right: 10px; padding: 6px 8px 5px; font-size: 11.5px; }
  .anim-scout .sc-ctl { gap: 8px; }
  .anim-scout .sc-ctl button { padding-inline: 12px; font-size: 14px; }
}
