/* Yuwen's avatar: drawn straight onto the note, with no white die-cut edge, so it doesn't read as
   one of the stickers you can peel off and move. Spot comes from avatar.js (?avatar=1|2|3). */
.yc-avatar{position:absolute;width:92px;height:92px;padding:0;border:0;background:none;cursor:pointer;
  transform-origin:50% 100%;-webkit-tap-highlight-color:transparent;
  filter:drop-shadow(0 1.5px 2px rgb(90 70 40/.22))}
.yc-avatar svg{display:block;width:100%;height:100%;overflow:visible;transform-origin:50% 90%}
.yc-avatar:focus-visible{outline:2px dashed var(--ink-3,#8b8170);outline-offset:6px;border-radius:50%}

.yc-avatar .yc-body{transform-box:view-box;transform-origin:710px 890px;animation:yc-breathe 5s ease-in-out infinite}
.yc-avatar .head{transform-box:view-box;transform-origin:710px 890px}
.yc-avatar .eye path:not(.yc-lid){transform-box:fill-box;transform-origin:50% 50%;animation:yc-blink 6s ease-in-out infinite;transition:transform .18s ease}
.yc-avatar .yc-pencil{transform-box:fill-box;transform-origin:50% 60%}

@keyframes yc-breathe{0%,100%{transform:none}50%{transform:scale(1.018,1.03)}}
@keyframes yc-blink{0%,44%,48%,100%{transform:none}46%{transform:scaleY(.1)}}

/* hover hop: squash, lift, land, small second bounce */
.yc-avatar.is-hop{animation:yc-hop .9s ease-out}
.yc-avatar.is-hop .eye path:not(.yc-lid){animation:none;transform:scale(1.15,.42)}
@keyframes yc-hop{
  0%{transform:none}
  14%{transform:scale(1.08,.9)}
  32%{transform:translateY(-14px) scale(.96,1.04)}
  52%{transform:scale(1.06,.94)}
  68%{transform:translateY(-5px)}
  84%{transform:scale(1.02,.98)}
  100%{transform:none}}

/* click: pencil wiggle + bubble */
.yc-avatar.is-wiggle .yc-pencil{animation:yc-wiggle .6s ease-in-out}
@keyframes yc-wiggle{0%,100%{transform:none}20%{transform:rotate(-14deg)}45%{transform:rotate(11deg)}70%{transform:rotate(-6deg)}}

/* pops out to the right, away from the note's text; the tail is its bottom-left corner */
.yc-bubble{position:absolute;left:58%;bottom:84%;width:max-content;max-width:220px;padding:5px 11px 6px;border-radius:12px 12px 12px 2px;background:#fff;color:var(--ink,#2f2a22);
  font:600 13px/1.25 var(--f-label,system-ui);letter-spacing:.02em;text-align:left;rotate:4deg;box-shadow:0 2px 6px rgb(90 70 40/.18);transform-origin:0 100%;
  opacity:0;scale:.6;translate:-6px 8px;transition:opacity .2s ease,scale .25s cubic-bezier(.3,1.5,.5,1),translate .25s ease;pointer-events:none}
.yc-avatar.is-hi .yc-bubble{opacity:1;scale:1;translate:0 0}

/* 1 · pressed onto the hero note's bottom-right corner */
.yc-on-note{right:-22px;bottom:-30px;rotate:8deg}
/* while she talks the note comes above the project stickers (.orbit, z 3), so the bubble does too */
.note-c:has(.yc-avatar.is-hi){z-index:4}

/* 1 · intro: the avatar stands big in the middle, the Hello line sits under it, and the
   objects pop out from behind it (.yc-origin is the pile one.js hands to scroll-intro.js) */
.yc-origin{display:none}
/* a longer runway than the usual 170vh, so a flick of the wheel only nudges the push into the eye */
.yc-big:not(.intro-off):not(.static-stage) .a-stage{height:calc(100vh + 420vh)}
/* a phone plays the intro on a clock (intro-clock.js): the stage is one screen, nothing to scroll through */
.intro-auto:not(.intro-off):not(.static-stage) .a-stage{height:100vh}
.intro-playing,.intro-playing body{overflow:hidden;touch-action:none} /* a swipe starts the intro instead of scrolling past it (intro-clock.js) */
.intro-playing:not(.intro-ready) .a-stage .hero-sheet,.intro-playing:not(.intro-ready) .a-stage .hero-sheet *{pointer-events:none!important} /* nothing on the sheet opens until the intro has played (the stickers set auto on themselves) */
.yc-big .yc-origin{display:block;position:absolute;left:50%;top:45%;translate:-50% -50%;width:min(26vh,36vw,260px);height:min(14vh,20vw,140px);pointer-events:none}
/* tucked under the hair: the drawing ends at 88% of its box (0.77 × half its size), and the
   line's own top spacing takes up the rest; size from
   avatar.js: min(62vh, 86vw, 760px) */
.yc-big .one .intro-word{top:calc(45% + min(31vh,43vw,380px) * .7);translate:-50% 0;font-size:clamp(28px,7vw,104px);transform-origin:0 0}
/* the cue sits just under the Hello, not at the bottom of the screen where a short window cuts it off */
.yc-big .one .scroll-cue{bottom:auto;top:min(calc(45% + min(31vh,43vw,380px) * .7 + clamp(28px,7vw,104px) * 1.2),calc(100% - 48px))}

/* the stand-in moved by avatar.js; z 7 like .pieces but later in the page, so the objects
   come out from behind it. It covers the stage and avatar.js zooms it through the SVG's
   viewBox (redrawn sharp at every size), so it never carries a CSS scale */
.yc-fly{position:absolute;left:0;top:0;z-index:7;pointer-events:none}
/* before the zoom the drawing itself (not the empty stage around it) can be clicked and says hi */
.yc-fly:not(.is-acting) .yc-body{pointer-events:visiblePainted;cursor:pointer}
.yc-fly .yc-bubble{left:var(--bx);top:var(--by);right:auto;bottom:auto;max-width:380px;translate:-100% -100%;padding:8px 16px 9px;border-radius:18px 18px 3px 18px;font-size:22px}
.yc-fly.is-hi .yc-bubble{opacity:1;scale:1;translate:-100% -100%}
.yc-fly[hidden]{display:none}
.yc-fly svg{display:block;width:100%;height:100%;overflow:visible}
.yc-fly .yc-body{transform-box:view-box;transform-origin:710px 890px;animation:yc-breathe 5s ease-in-out infinite}
.yc-fly .eye path:not(.yc-lid){transform-box:fill-box;transform-origin:50% 50%;animation:yc-blink 3.6s ease-in-out infinite}
/* on its own while you have not scrolled: glance left, glance right, wiggle the pencil */
.yc-fly .eye{animation:yc-look 5.2s cubic-bezier(.77,0,.175,1) infinite}
.yc-fly .yc-pencil{transform-box:fill-box;transform-origin:50% 60%;animation:yc-pencil-idle 5.2s ease-in-out infinite}
/* once scrolling starts, avatar.js drives everything frame by frame */
.yc-fly.is-acting .yc-body,.yc-fly.is-acting .eye,.yc-fly.is-acting .eye path:not(.yc-lid),.yc-fly.is-acting .yc-pencil{animation:none}
.yc-fly.is-wiggle .yc-pencil{animation:yc-wiggle .6s ease-in-out}
/* the inside of the eye, over the desk (z 2) and under the popping objects (z 7) */
.yc-dark{position:absolute;inset:0;z-index:6;pointer-events:none}
.yc-dark[hidden]{display:none}
@keyframes yc-look{0%,12%,52%,100%{transform:none}20%,30%{transform:translateX(-26px)}38%,46%{transform:translateX(26px)}}
@keyframes yc-pencil-idle{0%,60%,82%,100%{transform:none}66%{transform:rotate(-10deg)}72%{transform:rotate(8deg)}77%{transform:rotate(-4deg)}}

/* 2 · one more sticker among the project objects, in the gap below the note */
.yc-in-orbit{left:61%;top:87%;translate:-50% -50%;width:min(6.6vw,11vh,96px);height:min(6.6vw,11vh,96px);rotate:-5deg;pointer-events:auto}
.yc-in-orbit::after{content:"that’s me";position:absolute;left:50%;top:calc(100% + 4px);translate:-50% 0;rotate:-3deg;white-space:nowrap;
  font:500 11px/1.2 var(--f-label,system-ui);letter-spacing:.06em;color:var(--ink-3,#8b8170);opacity:0;scale:.9;transition:opacity .2s,scale .2s;pointer-events:none}
.yc-in-orbit:hover::after,.yc-in-orbit:focus-visible::after{opacity:1;scale:1}

/* 3 · docked bottom-right: only the top of the head shows until you come close */
.yc-dock{position:fixed;right:clamp(16px,4vw,48px);bottom:-46px;z-index:30;width:96px;height:96px;
  transition:bottom .35s cubic-bezier(.3,1.4,.5,1)}
.yc-dock:hover,.yc-dock:focus-visible,.yc-dock.is-hi{bottom:-14px}
.yc-dock .yc-bubble{left:auto;right:62%;bottom:70%;border-radius:12px 12px 2px 12px;rotate:-4deg;transform-origin:100% 100%}

/* poke faces (avatar-poke.js puts the mood on the sticker as data-mood). Hidden by default:
   the drawing keeps its eyes-only face until poked */
.yc-mouth>*,.yc-blush,.yc-sweat{opacity:0;transition:opacity .12s ease}
.yc-sweat{transform-box:fill-box;transform-origin:50% 0}
/* lids: skin over the top of each eye, slanted in for cross, flat for sleepy */
.yc-lid{opacity:0;transition:opacity .12s ease}
[data-mood~=cross] .yc-lid-cross,[data-mood~=sleepy] .yc-lid-sleepy{opacity:1}
[data-mood~=smile] .m-smile,[data-mood~=grin] .m-grin,[data-mood~=o] .m-o,[data-mood~=flat] .m-flat,
[data-mood~=wobble] .m-wobble,[data-mood~=cat] .m-cat,[data-mood~=pout] .m-pout{opacity:1}
[data-mood~=blush] .yc-blush{opacity:.6}
[data-mood~=sweat] .yc-sweat{opacity:1;animation:yc-sweat 1.2s ease-in infinite}
[data-mood~=happy] .eye path:not(.yc-lid){animation:none!important;transform:scale(1.15,.42)}
[data-mood~=wide] .eye path:not(.yc-lid){animation:none!important;transform:scale(1.18)}
[data-mood~=shut] .eye path:not(.yc-lid){animation:none!important;transform:scale(1.1,.08)}
[data-mood~=wink] .eye path:not(.yc-lid){animation:none!important}
[data-mood~=wink] .yc-eye-r path:not(.yc-lid){transform:scale(1.15,.12)}
@keyframes yc-sweat{0%{transform:translateY(-6px) scale(.8)}60%{transform:translateY(8px) scale(1)}100%{transform:translateY(14px) scale(1);opacity:0}}
/* the little bits that pop off her head */
.yc-bit{position:absolute;left:50%;top:6%;z-index:2;pointer-events:none;font:700 18px/1 var(--f-label,system-ui);color:#f2b705;text-shadow:0 1px 0 #fff,0 0 3px #fff}
.yc-bit-heart,.yc-bit-love{color:#ff6f91}
.yc-bit-note{color:#7a6cf0}
.yc-bit-what,.yc-bit-sleep{color:var(--ink-3,#8b8170)}
.yc-bit-cross{color:#e5533d}
.yc-fly .yc-bit{left:var(--bx);top:var(--by);font-size:34px}

@media (max-width:760px){
  .yc-on-note{width:68px;height:68px;right:-8px;bottom:-26px}
  .yc-in-orbit{position:relative;left:auto;top:auto;translate:none;width:min(14vw,58px);height:min(14vw,58px);justify-self:center;align-self:center}
  .yc-in-orbit::after{opacity:1;scale:1}
  .yc-dock{width:72px;height:72px;bottom:-30px;right:16px}
  .yc-dock.is-hi{bottom:-8px}
  .yc-bubble{max-width:180px;font-size:12px}
  /* a phone has no room to the sticker's right (it sits at the screen edge): the bubble drops
     below it instead, still clear of the note's text, tail at its top-right corner */
  .yc-on-note .yc-bubble{left:auto;right:6%;bottom:auto;top:98%;border-radius:12px 2px 12px 12px;rotate:-3deg;transform-origin:100% 0;translate:0 -8px}}
@media (prefers-reduced-motion:reduce){
  .yc-avatar,.yc-avatar *{animation:none!important;transition:none!important}
  .yc-avatar.is-hi .yc-bubble{opacity:1;scale:1;translate:0 0}}
