/* The prize mug, turning: a real object in the browser's own 3D, of HTML and CSS alone. Made by tools/mug.py: change it there.
   It is drawn in a box 340px square. Set --k on .mug to make it bigger or smaller: .5 is half that. */
.mug{--k:1; position:relative; display:block; flex:none; width:calc(340px * var(--k)); height:calc(340px * var(--k)); perspective:calc(2600px * var(--k))}   /* (from far enough off that the rim, which leans towards the eye, is not made to look as wide as the foot) */
.mug *,.mug *::before,.mug *::after{position:absolute; box-sizing:border-box; transform-style:preserve-3d}
/* its shadow, on whatever it stands on */
.mug::before{content:""; position:absolute; left:46%; top:50%; width:calc(330px * var(--k)); height:calc(86px * var(--k)); margin:calc(43px * var(--k)) 0 0 calc(-165px * var(--k));
  border-radius:50%; background:radial-gradient(closest-side, rgba(43,33,64,.34), rgba(43,33,64,0))}
/* looked at from a little above; drawn at its own size and scaled to fit; and turning */
.mug .tilt{left:46%; top:50%; width:0; height:0; transform:scale(calc(var(--k) * 1.16)) translateY(-82px) rotateX(-19deg)}   /* (so that the mug, rim to foot, is in the middle of its box) */
.mug .turn{left:0; top:0; width:0; height:0; animation:mug-turn 9s linear infinite}
@keyframes mug-turn{to{transform:rotateY(360deg)}}
/* a stave: stood at the foot's edge, leaned in to the rim, narrower at the top, with its share of the picture on it */
/* (They are not cut narrower towards the rim: each is left its full width and overlaps the next one a little there. A hundred
   and twenty cut-out layers in 3D were what made the mug heavy to draw, and the overlap does not show.) */
.mug .stave,.mug .inner{top:-1.035px; height:157.035px; transform-origin:50% 100%; backface-visibility:hidden}
.mug .stave{left:-11.310px; width:22.621px; transform:rotateY(calc(var(--i) * 12.0deg)) translateZ(99.452px) rotateX(6.582deg);
  background:url(art.svg) calc(var(--i) * -21.0208px + 0.8px) 0 / 630.625px 100%}
/* the inside: the same staves seen from within, glazed, darker down towards the floor */
.mug .inner{left:-16.005px; width:32.010px; transform:rotateY(calc(var(--i) * 18.0deg)) translateZ(94.818px) rotateX(6.582deg) rotateY(180deg); background:linear-gradient(#6C8DDB, #4467BF 45%, #2B4796)}
@keyframes mug-in{0%,100%{opacity:.3} 25%{opacity:.14} 50%{opacity:0} 62%{opacity:.05} 75%{opacity:.2}}
/* the floor inside, the rim round the top, and the foot it stands on */
.mug .floor,.mug .rim,.mug .foot{border-radius:50%; transform:rotateX(90deg)}
.mug .floor{left:-95px; top:47.0px; width:190px; height:190px; background:radial-gradient(#2A4796, #1E3478)}
.mug .rim{left:-83.0px; top:-83.0px; width:166.0px; height:166.0px; border:7px solid #A9C0F1; box-shadow:0 0 0 1.5px #5571C2, inset 0 0 0 1.5px #5571C2}
/* light along the rim: it does not turn with the mug, so it is turned back the other way as fast */
.mug .rim::after{content:""; inset:-7px; border-radius:50%; border:7px solid transparent; border-left-color:rgba(255,255,255,.85); border-bottom-color:rgba(255,255,255,.3); filter:blur(.6px); animation:mug-back 9s linear infinite}
@keyframes mug-back{from{transform:rotate(-35deg)} to{transform:rotate(-395deg)}}
.mug .foot{left:-99px; top:56.0px; width:198px; height:198px; background:#1B3070}
/* the handle: it stands out from the side away from the picture, and goes round with the mug */
.mug .handle{left:0; top:0; width:0; height:0; transform:rotateY(-90deg)}
.mug .seg{left:0; top:0; width:0; height:0; transform:translate3d(var(--x), var(--y), 0) rotateZ(var(--a)); --c:#F1EDE3; --d:#DDD7C8; --e:#C9C2B1}
.mug .seg.glazed{--c:#7F9DE3; --d:#6585D2; --e:#5373C4}
.mug .seg.dipped b{background-image:linear-gradient(90deg, #6585D2, #DDD7C8)}
.mug .seg b{left:calc(var(--l) / -2); width:var(--l); border-radius:5px}
.mug .seg b:nth-child(1),.mug .seg b:nth-child(2){top:-6.5px; height:13px; background:var(--d)}      /* its two flat sides */
.mug .seg b:nth-child(1){transform:translateZ(10px)} .mug .seg b:nth-child(2){transform:translateZ(-10px)}
.mug .seg b:nth-child(3),.mug .seg b:nth-child(4){top:-10px; height:20px}                           /* its back and its belly */
.mug .seg b:nth-child(3){transform:rotateX(90deg) translateZ(6.5px); background:linear-gradient(var(--c) 0 28%, #fff 44% 56%, var(--c) 72%)} .mug .seg b:nth-child(4){transform:rotateX(90deg) translateZ(-6.5px); background:var(--e)}
/* The light. It stays where it is while the mug turns, and a mug is the same shape from every side: so the light is one
   flat picture laid over it, cut to the mug's outline, and nothing in it moves. Dark round towards each side, a hard bright
   streak where the light strikes, a thin second light on the far edge; and the same, gentler, in the mouth. */
.mug .light,.mug .well{left:0; top:0; width:340px; height:340px; transform:scale(var(--k)); transform-origin:0 0; transform-style:flat; pointer-events:none}
.mug .light{clip-path:polygon(61.3px 74.9px, 61.4px 77.8px, 62.6px 80.7px, 64.8px 83.5px, 68.1px 86.3px, 72.3px 89.0px, 77.6px 91.5px, 83.7px 93.8px, 90.7px 96.0px, 98.5px 97.9px, 107.0px 99.6px, 116.0px 101.0px, 125.5px 102.1px, 135.5px 102.9px, 145.6px 103.4px, 155.9px 103.5px, 166.2px 103.4px, 176.4px 102.9px, 186.3px 102.1px, 195.9px 101.0px, 205.0px 99.6px, 213.5px 97.9px, 221.4px 96.0px, 228.4px 93.8px, 234.7px 91.5px, 240.0px 89.0px, 244.3px 86.3px, 247.7px 83.5px, 250.0px 80.7px, 251.3px 77.8px, 251.5px 74.9px, 270.1px 244.3px, 269.9px 248.5px, 268.5px 252.7px, 265.8px 256.8px, 261.9px 260.8px, 256.7px 264.7px, 250.4px 268.4px, 243.0px 271.8px, 234.6px 275.0px, 225.2px 277.8px, 215.0px 280.2px, 204.1px 282.3px, 192.6px 283.9px, 180.7px 285.1px, 168.5px 285.8px, 156.1px 286.0px, 143.8px 285.8px, 131.6px 285.1px, 119.7px 283.9px, 108.2px 282.3px, 97.4px 280.2px, 87.3px 277.8px, 78.0px 275.0px, 69.6px 271.8px, 62.3px 268.4px, 56.1px 264.7px, 51.1px 260.8px, 47.3px 256.8px, 44.7px 252.7px, 43.3px 248.5px, 43.3px 244.3px);
  background:linear-gradient(90deg, rgba(20,19,58,.66) 12.7%, rgba(20,19,58,.3) 17.4%, rgba(20,19,58,.06) 24.1%, transparent 32.7%, transparent 46.1%, rgba(20,19,58,.12) 58.1%, rgba(20,19,58,.42) 70.1%, rgba(20,19,58,.74) 79.5%)}
/* (the streak is at its brightest on the glaze, which is glass, and softer on the bare clay under it) */
.mug .light::after{content:""; inset:0;
  background:
    linear-gradient(92.5deg, transparent 21.4%, rgba(255,255,255,.16) 26.1%, rgba(255,255,255,.9) 29.1%, rgba(255,255,255,.95) 31.1%, rgba(255,255,255,.2) 34.7%, transparent 40.8%),
    linear-gradient(85.5deg, transparent 69.4%, rgba(255,255,255,.34) 73.1%, transparent 76.1%);
  -webkit-mask-image:linear-gradient(#000 35.7%, rgba(0,0,0,.6) 40.7%, rgba(0,0,0,.6) 75.4%, #000 79.2%); mask-image:linear-gradient(#000 35.7%, rgba(0,0,0,.6) 40.7%, rgba(0,0,0,.6) 75.4%, #000 79.2%)}
.mug .well{clip-path:ellipse(86.6px 28.2px at 156.4px 74.9px);
  background:
    radial-gradient(ellipse 43.3px 21.2px at 120.0px 67.8px, rgba(255,255,255,.5), rgba(255,255,255,0) 70%),
    linear-gradient(rgba(16,26,74,0) 13.7%, rgba(16,26,74,.5) 30.3%)}
@media (prefers-reduced-motion:reduce){ .mug .turn{animation:none; transform:rotateY(-32deg)} .mug .rim::after{animation-play-state:paused} }
