/* The chef at the top of the page.
   One 12s loop, in beats:
     0-22%   stir
     22-36%  taste it, eyes shut, a tick of approval
     36-52%  toss the pan, food in the air, the fire flares
     52-68%  sprinkle the garnish from the spice pot
     68-84%  plate up
     84-100% send it along the counter
   Decorative: it never takes a click, and it holds still for anyone who has
   asked for reduced motion. */
.chef-scene{
    pointer-events:none;
    user-select:none;
    width:100%;
    max-width:340px;
    margin:0 auto;
}
.chef-scene-svg{ width:100%; height:auto; display:block; overflow:visible; }

/* ---- palette ------------------------------------------------------------ */
.cs-glow{ fill:url(#chefGlow); opacity:.5; }

.cs-coat{ fill:url(#chefCoat); stroke:#cbdcd2; stroke-width:1.4; stroke-linejoin:round; }
.cs-coat-shade{ fill:#14432f; opacity:.045; }
.cs-collar{ fill:#14432f; }
.cs-btn{ fill:#aec5b8; }
.cs-neck{ fill:url(#chefSkin); }
.cs-neck-shade{ fill:#c98f63; opacity:.35; }

/* the arms are strokes, not boxes: a soft edge under a white sleeve gives a
   rounded limb with an elbow, and the cuff hides the join */
.cs-limb-edge{ fill:none; stroke:#cbdcd2; stroke-width:16; stroke-linecap:round; }
.cs-limb{ fill:none; stroke:#fff; stroke-width:13.2; stroke-linecap:round; }
.cs-cuff{ fill:#f3f8f5; stroke:#cbdcd2; stroke-width:1.4; }
.cs-hand,.cs-thumb,.cs-ear,.cs-face{ fill:url(#chefSkin); }

.cs-toque{ fill:url(#chefToque); stroke:#cbdcd2; stroke-width:1.4; stroke-linejoin:round; }
.cs-toque-band{ fill:#fff; stroke:#cbdcd2; stroke-width:1.3; }
.cs-toque-fold{ fill:none; stroke:#dce8e2; stroke-width:1.2; stroke-linecap:round; }

.cs-hair{ fill:#2f231a; }
.cs-pupil{ fill:#2b2118; }
.cs-spark{ fill:#fff; }
.cs-eyes-shut path{ fill:none; stroke:#2b2118; stroke-width:1.8; stroke-linecap:round; }
.cs-eyes-shut{ opacity:0; }
.cs-brow{ fill:none; stroke:#2f231a; stroke-width:1.7; stroke-linecap:round; }
.cs-tache{ fill:#2f231a; }
.cs-smile{ fill:none; stroke:#2b2118; stroke-width:1.6; stroke-linecap:round; }
.cs-blush{ fill:#e07a4a; opacity:.26; }
.cs-approve{ fill:none; stroke:#1c6b3c; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; opacity:0; }

.cs-counter{ fill:url(#chefCounter); }
.cs-counter-front{ fill:#a9bdb1; }
.cs-burner{ fill:#8fa79a; }
.cs-pan-body{ fill:url(#chefPan); }
.cs-pan-handle{ fill:none; stroke:#2f3a40; stroke-width:5; stroke-linecap:round; }
.cs-curry{ fill:url(#chefCurry); }
.cs-bubble{ fill:#ffd08a; opacity:0; }
.cs-flame{ fill:url(#chefFlame); }
.cs-ladle rect,.cs-ladle ellipse{ fill:#8a969c; }
.cs-plate-base{ fill:#fff; stroke:#cfded6; stroke-width:1.3; }
.cs-plate-food{ fill:#e8a04b; }
.cs-plate-bit{ fill:#c8562c; }
.cs-sparkle{ fill:#f2b23c; opacity:0; }
.cs-toss-bit{ fill:#d9722c; opacity:0; }
.cs-spice-pot{ fill:#b7543a; }
.cs-spice-lid{ fill:#8d3f2c; }
.cs-speck{ fill:#8d3f2c; opacity:0; }
.cs-wisp{ fill:none; stroke:#14432f; stroke-width:2.6; stroke-linecap:round; opacity:0; }

/* ---- things that never stop --------------------------------------------- */
.cs-wisp-1{ animation:cs-rise 3.2s ease-in-out infinite; }
.cs-wisp-2{ animation:cs-rise 3.2s ease-in-out .5s infinite; }
.cs-wisp-3{ animation:cs-rise 3.2s ease-in-out 1s infinite; }
@keyframes cs-rise{
    0%{ opacity:0; transform:translateY(6px) scaleX(.75); }
    35%{ opacity:.3; }
    100%{ opacity:0; transform:translateY(-16px) scaleX(1.15); }
}

.cs-flame-a{ transform-origin:207px 111px; animation:cs-flicker .6s ease-in-out infinite alternate; }
.cs-flame-b{ transform-origin:216px 111px; animation:cs-flicker .5s ease-in-out .15s infinite alternate; }
.cs-flame-c{ transform-origin:225px 111px; animation:cs-flicker .7s ease-in-out .3s infinite alternate; }
@keyframes cs-flicker{
    from{ transform:scaleY(.82) scaleX(1.05); opacity:.85; }
    to{ transform:scaleY(1.12) scaleX(.95); opacity:1; }
}

.cs-bubble-1{ animation:cs-bubble 2.1s ease-in-out infinite; }
.cs-bubble-2{ animation:cs-bubble 2.1s ease-in-out .6s infinite; }
.cs-bubble-3{ animation:cs-bubble 2.1s ease-in-out 1.2s infinite; }
@keyframes cs-bubble{
    0%,100%{ opacity:0; transform:translateY(0) scale(.6); }
    45%{ opacity:.85; transform:translateY(-3px) scale(1); }
}

/* ---- the 12s loop -------------------------------------------------------- */

.cs-glow{ transform-origin:214px 96px; animation:cs-glow 12s ease-in-out infinite; }
@keyframes cs-glow{
    0%,36%{ opacity:.35; transform:scale(1); }
    43%{ opacity:.9; transform:scale(1.22); }
    52%,100%{ opacity:.35; transform:scale(1); }
}
.cs-flames{ transform-origin:216px 112px; animation:cs-flare 12s ease-in-out infinite; }
@keyframes cs-flare{
    0%,36%{ transform:scaleY(1); }
    43%{ transform:scaleY(1.9); }
    52%,100%{ transform:scaleY(1); }
}

/* body: leans in to taste, rocks with the toss, reaches out to serve */
.cs-body{ transform-origin:108px 124px; animation:cs-body 12s ease-in-out infinite; }
@keyframes cs-body{
    0%,20%{ transform:translateX(0) rotate(0deg); }
    28%{ transform:translateX(3px) rotate(1.5deg); }
    36%{ transform:translateX(0) rotate(0deg); }
    42%{ transform:translateX(-3px) rotate(-2deg); }
    48%{ transform:translateX(2px) rotate(1deg); }
    66%{ transform:translateX(0) rotate(0deg); }
    74%,86%{ transform:translateX(7px) rotate(2.5deg); }
    94%,100%{ transform:translateX(0) rotate(0deg); }
}

/* head: dips toward the pan to taste, nods, then turns to the guest */
.cs-head{ transform-origin:108px 84px; animation:cs-head 12s ease-in-out infinite; }
@keyframes cs-head{
    0%,20%{ transform:rotate(0deg) translate(0,0); }
    25%{ transform:rotate(9deg) translate(4px,2px); }
    29%{ transform:rotate(9deg) translate(4px,4px); }
    32%{ transform:rotate(9deg) translate(4px,1px); }
    36%{ transform:rotate(0deg) translate(0,0); }
    72%,86%{ transform:rotate(6deg) translate(2px,0); }
    94%,100%{ transform:rotate(0deg) translate(0,0); }
}

/* eyes: open normally, shut tight while tasting */
.cs-eyes{ animation:cs-eyes 12s ease-in-out infinite; }
@keyframes cs-eyes{
    0%,23%{ opacity:1; }
    25%,33%{ opacity:0; }
    35%,100%{ opacity:1; }
}
.cs-eyes-shut{ animation:cs-eyes-shut 12s ease-in-out infinite; }
@keyframes cs-eyes-shut{
    0%,23%{ opacity:0; }
    25%,33%{ opacity:1; }
    35%,100%{ opacity:0; }
}

/* the tick of approval, right after the taste */
.cs-approve{ transform-origin:136px 46px; animation:cs-approve 12s ease-out infinite; }
@keyframes cs-approve{
    0%,30%{ opacity:0; transform:scale(.3) translateY(4px); }
    34%{ opacity:1; transform:scale(1.15) translateY(-2px); }
    38%{ opacity:1; transform:scale(1) translateY(-4px); }
    44%,100%{ opacity:0; transform:scale(1) translateY(-8px); }
}

/* the working arm, pivoting at the shoulder */
.cs-arm{ transform-origin:130px 96px; animation:cs-arm 12s ease-in-out infinite; }
@keyframes cs-arm{
    0%{ transform:rotate(-3deg); }
    7%{ transform:rotate(3deg); }
    14%{ transform:rotate(-3deg); }
    20%{ transform:rotate(2deg); }
    25%{ transform:rotate(-13deg); }
    32%{ transform:rotate(-13deg); }
    36%{ transform:rotate(-2deg); }
    40%{ transform:rotate(-8deg); }
    46%{ transform:rotate(2deg); }
    52%{ transform:rotate(-2deg); }
    68%{ transform:rotate(0deg); }
    74%{ transform:rotate(7deg); }
    86%{ transform:rotate(7deg); }
    94%,100%{ transform:rotate(-3deg); }
}

/* the spare arm rests; the working hand does the sprinkling */
.cs-speck-1{ animation:cs-speck 12s ease-in infinite; }
.cs-speck-2{ animation:cs-speck 12s ease-in .25s infinite; }
.cs-speck-3{ animation:cs-speck 12s ease-in .5s infinite; }
@keyframes cs-speck{
    0%,57%{ opacity:0; transform:translate(0,0); }
    59%{ opacity:1; transform:translate(1px,1px); }
    66%{ opacity:.85; transform:translate(9px,11px); }
    69%,100%{ opacity:0; transform:translate(12px,15px); }
}

/* the pan tips for the toss */
.cs-pan{ transform-origin:244px 86px; animation:cs-pan 12s ease-in-out infinite; }
@keyframes cs-pan{
    0%,38%{ transform:rotate(0deg) translateY(0); }
    41%{ transform:rotate(-13deg) translateY(-4px); }
    45%{ transform:rotate(7deg) translateY(0); }
    49%,100%{ transform:rotate(0deg) translateY(0); }
}

/* food thrown out of the pan and caught again */
.cs-toss-1{ animation:cs-toss-a 12s ease-out infinite; }
.cs-toss-2{ animation:cs-toss-b 12s ease-out infinite; }
.cs-toss-3{ animation:cs-toss-c 12s ease-out infinite; }
@keyframes cs-toss-a{
    0%,39%{ opacity:0; transform:translate(0,0); }
    40%{ opacity:1; transform:translate(0,0); }
    43%{ opacity:1; transform:translate(-5px,-26px); }
    47%{ opacity:1; transform:translate(-8px,2px); }
    48%,100%{ opacity:0; transform:translate(-8px,2px); }
}
@keyframes cs-toss-b{
    0%,39%{ opacity:0; transform:translate(0,0); }
    40%{ opacity:1; transform:translate(0,0); }
    44%{ opacity:1; transform:translate(2px,-34px); }
    48%{ opacity:1; transform:translate(4px,2px); }
    49%,100%{ opacity:0; transform:translate(4px,2px); }
}
@keyframes cs-toss-c{
    0%,39%{ opacity:0; transform:translate(0,0); }
    41%{ opacity:1; transform:translate(0,0); }
    44%{ opacity:1; transform:translate(7px,-22px); }
    48%{ opacity:1; transform:translate(10px,2px); }
    49%,100%{ opacity:0; transform:translate(10px,2px); }
}

/* the hand carries the ladle, then the spice pot, then the plate */
.cs-ladle{ animation:cs-ladle 12s steps(1,end) infinite; }
@keyframes cs-ladle{
    0%,53%{ opacity:1; }
    54%,91%{ opacity:0; }
    92%,100%{ opacity:1; }
}
.cs-spice{ opacity:0; transform-origin:185px 76px; animation:cs-spice 12s ease-in-out infinite; }
@keyframes cs-spice{
    0%,53%{ opacity:0; transform:rotate(0deg); }
    56%{ opacity:1; transform:rotate(-16deg); }
    59%{ opacity:1; transform:rotate(-30deg); }
    62%{ opacity:1; transform:rotate(-18deg); }
    65%{ opacity:1; transform:rotate(-30deg); }
    67%{ opacity:1; transform:rotate(-16deg); }
    69%,100%{ opacity:0; transform:rotate(0deg); }
}
.cs-plate{ opacity:0; transform-origin:191px 94px; animation:cs-plate 12s ease-in-out infinite; }
@keyframes cs-plate{
    0%,67%{ opacity:0; transform:scale(.7); }
    71%{ opacity:1; transform:scale(1); }
    86%{ opacity:1; transform:scale(1); }
    90%,100%{ opacity:0; transform:scale(.7); }
}

/* the finished plate goes along the counter to the guest */
.cs-served{ opacity:0; animation:cs-served 12s ease-out infinite; }
@keyframes cs-served{
    0%,84%{ opacity:0; transform:translateX(-26px); }
    89%{ opacity:1; transform:translateX(0); }
    97%{ opacity:1; transform:translateX(8px); }
    100%{ opacity:0; transform:translateX(16px); }
}
.cs-sparkle{ transform-origin:310px 104px; animation:cs-sparkle 12s ease-out infinite; }
@keyframes cs-sparkle{
    0%,89%{ opacity:0; transform:scale(.4) rotate(0deg); }
    93%{ opacity:1; transform:scale(1) rotate(45deg); }
    98%,100%{ opacity:0; transform:scale(.5) rotate(90deg); }
}

@media (max-width:600px){
    .chef-scene{ max-width:260px; }
}

/* Held still, but still drawn, when less motion is asked for. */
@media (prefers-reduced-motion: reduce){
    .chef-scene-svg *{ animation:none !important; }
    .cs-plate,.cs-served,.cs-sparkle,.cs-bubble,.cs-wisp,
    .cs-toss-bit,.cs-speck,.cs-approve,.cs-eyes-shut{ opacity:0; }
    .cs-ladle,.cs-eyes{ opacity:1; }
}
