/* Tilde and Clo, quiet: Tilde standing, Clo asleep at her boot.
   A still, cut into flat layers that this stylesheet moves: Clo breathes and snores her "~",
   Tilde blinks, and now and then taps a toe. No video, no canvas, no 3D.
   Size it with --tilde-clo-width. Made by scripts/site-piece-build.mjs in the character kit: change it there, not here. */
.tilde-clo {
  --tilde-clo-width: 300px;
  position: relative;
  display: block;
  box-sizing: content-box;
  width: var(--tilde-clo-width);
  height: calc(var(--tilde-clo-width) * 1.19101);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tilde-clo:focus-visible { outline: 2px solid #f08a2a; outline-offset: 6px; border-radius: 12px; }
.tilde-clo span { position: absolute; display: block; background: no-repeat 0 0 / 100% 100%; pointer-events: none; }
.tilde-clo .tc-back { left: 21.91%; top: 88.561%; width: 71.208%; height: 10.495%; background-image: url(back.webp); }
/* The button beside her right hand: one pad from a DJ controller, seen from the front. A dark housing, and in it a square rubber pad lit from
   inside, brightest at its centre. Unlit it glows slowly, as an invitation; while her music is heard it is fully lit and pressed in.
   Tapping anywhere on the two of them does the same. Its colour is three values: --tc-pad, --tc-pad-hot (its centre), --tc-pad-deep (its edge). */
.tilde-clo .tc-button { --tc-pad: #5fe63c; --tc-pad-hot: #e4ffd0; --tc-pad-deep: #2fb81c; z-index: 0; left: 1.5%; top: 78.5%; width: 14%; height: 11.755%; border-radius: 24%; background: linear-gradient(#333848, #14161f); box-shadow: 0 0.55em 0 #08090e, inset 0 0 0 0.22em rgba(255, 255, 255, 0.16); font-size: calc(var(--tilde-clo-width) * 0.01); }
.tilde-clo .tc-button::before { content: ""; position: absolute; inset: 13%; border-radius: 20%; background: radial-gradient(circle at 50% 46%, var(--tc-pad-hot) 0%, var(--tc-pad) 46%, var(--tc-pad-deep) 100%); box-shadow: inset 0 0 0 0.16em rgba(255, 255, 255, 0.3), inset 0 -0.5em 0.8em rgba(0, 0, 0, 0.18); opacity: 0.9; animation: tc-pad 2.609s ease-in-out infinite; transition: transform 0.12s; }
.tilde-clo .tc-button::after { content: ""; position: absolute; z-index: -1; inset: -55%; border-radius: 50%; background: radial-gradient(closest-side, var(--tc-pad) 0%, transparent 100%); opacity: 0.4; animation: tc-glow 2.609s ease-in-out infinite; }
.tilde-clo.is-playing .tc-button::before { transform: scale(0.94); opacity: 1; animation: none; background: radial-gradient(circle at 50% 46%, #fff 0%, var(--tc-pad-hot) 30%, var(--tc-pad) 72%, var(--tc-pad-deep) 100%); }
.tilde-clo.is-playing .tc-button::after { animation: none; opacity: 0.75; }
.tilde-clo .tc-toe { left: 32.584%; top: 78.066%; width: 18.118%; height: 16.392%; background-image: url(toe.webp); background-size: 400% 100%; animation: tc-toe 11.7s step-end infinite; }
.tilde-clo .tc-tail { left: 77.247%; top: 80.896%; width: 11.798%; height: 10.495%; background-image: url(clo-tail.webp); transform-origin: -28.091% 143.133%; transform: scale(1.0261, 1.0548); animation: tc-breath 3.9s linear infinite; will-change: transform; }
.tilde-clo .tc-tilde { left: 1.124%; top: 0.943%; width: 97.612%; height: 94.104%; background-image: url(tilde.webp); }
.tilde-clo .tc-lids { left: 24.438%; top: 33.137%; width: 41.011%; height: 8.844%; background-image: url(lids.webp); background-size: 200% 100%; opacity: 0; animation: tc-blink 7.8s step-end infinite; }
.tilde-clo .tc-body { left: 60.112%; top: 80.542%; width: 26.264%; height: 16.274%; background-image: url(clo-body.webp); transform-origin: 52.622% 94.484%; transform: scale(1.0261, 1.0548); animation: tc-breath 3.9s linear infinite; will-change: transform; }
.tilde-clo .tc-ears { left: 56.461%; top: 76.887%; width: 32.303%; height: 4.717%; background-image: url(clo-ears.webp); transform: translate(-0.298%, -25.601%); animation: tc-ears 3.9s linear infinite; will-change: transform; }
.tilde-clo .tc-snore { left: 74.719%; top: 69.458%; width: 5.337%; height: 1.297%; background-image: url(clo-snore.webp); transform: translate(14.713%, 130.313%) rotate(-0.24deg); opacity: 0.715; animation: tc-snore 3.9s linear infinite; will-change: transform, opacity; }
/* While her music is heard (a visitor tapped), her toe taps along more often. */
.tilde-clo.is-playing .tc-toe { animation: tc-toe-on 3.9s step-end infinite; }
/* In time with the music: see the note in scripts/site-piece-build.mjs. Part 2 (the drums are in): her toe on every beat, and a small bob.
   Part 3 (bass and melody too): a bigger bob, a sway from side to side, and Clo's ears twitch in her sleep. The pad flashes on the beat. */
.tilde-clo .tc-toe { transform-origin: 108% 99.281%; }
.tilde-clo .tc-tilde { transform-origin: 52.276% 99.248%; }
.tilde-clo .tc-lids { transform-origin: 67.575% 692%; }
.tilde-clo .tc-ears { transform-origin: 50% 100%; }
.tilde-clo[data-part="2"][data-turn="a"] .tc-tilde { animation: tc-bob-a 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="2"][data-turn="a"] .tc-toe { animation: tc-beat-toe-a 0.6522s step-end infinite, tc-bob-a 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="2"][data-turn="a"] .tc-lids { animation: tc-blink 7.8s step-end infinite, tc-bob-a 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="a"] .tc-tilde { animation: tc-bob-more-a 0.6522s ease-in-out infinite, tc-sway-a 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="a"] .tc-toe { animation: tc-beat-toe-a 0.6522s step-end infinite, tc-bob-more-a 0.6522s ease-in-out infinite, tc-sway-a 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="a"] .tc-lids { animation: tc-blink 7.8s step-end infinite, tc-bob-more-a 0.6522s ease-in-out infinite, tc-sway-a 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="a"] .tc-ears { animation: tc-ears 3.9s linear infinite, tc-twitch-a 5.2174s linear infinite; }
.tilde-clo[data-part="2"][data-turn="a"] .tc-button::before, .tilde-clo[data-part="3"][data-turn="a"] .tc-button::before { animation: tc-hit-a 0.6522s ease-out infinite; }
.tilde-clo[data-part="2"][data-turn="a"] .tc-button::after, .tilde-clo[data-part="3"][data-turn="a"] .tc-button::after { animation: tc-hit-glow-a 0.6522s ease-out infinite; }
@keyframes tc-bob-a { 0%, 100% { scale: 1 0.993; } 50% { scale: 1 1; } }
@keyframes tc-bob-more-a { 0%, 100% { scale: 1 0.988; } 50% { scale: 1 1; } }
@keyframes tc-sway-a { 0%, 100% { rotate: -0.6deg; } 50% { rotate: 0.6deg; } }
@keyframes tc-beat-toe-a {
  0% { background-position: 0% 0; }
  62% { background-position: 33.333% 0; }
  72% { background-position: 66.667% 0; }
  80% { background-position: 100% 0; }
  90% { background-position: 66.667% 0; }
  96% { background-position: 33.333% 0; }
}
@keyframes tc-twitch-a { 0%, 21.5% { rotate: 0deg; } 22.6% { rotate: 3deg; } 23.8% { rotate: 0deg; } 25% { rotate: 1.5deg; } 26.3%, 71.5% { rotate: 0deg; } 72.6% { rotate: -2.5deg; } 73.9%, 100% { rotate: 0deg; } }
@keyframes tc-hit-a { 0% { opacity: 1; } 100% { opacity: 0.8; } }
@keyframes tc-hit-glow-a { 0% { opacity: 0.9; } 100% { opacity: 0.4; } }
.tilde-clo[data-part="2"][data-turn="b"] .tc-tilde { animation: tc-bob-b 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="2"][data-turn="b"] .tc-toe { animation: tc-beat-toe-b 0.6522s step-end infinite, tc-bob-b 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="2"][data-turn="b"] .tc-lids { animation: tc-blink 7.8s step-end infinite, tc-bob-b 0.6522s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="b"] .tc-tilde { animation: tc-bob-more-b 0.6522s ease-in-out infinite, tc-sway-b 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="b"] .tc-toe { animation: tc-beat-toe-b 0.6522s step-end infinite, tc-bob-more-b 0.6522s ease-in-out infinite, tc-sway-b 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="b"] .tc-lids { animation: tc-blink 7.8s step-end infinite, tc-bob-more-b 0.6522s ease-in-out infinite, tc-sway-b 1.3043s ease-in-out infinite; }
.tilde-clo[data-part="3"][data-turn="b"] .tc-ears { animation: tc-ears 3.9s linear infinite, tc-twitch-b 5.2174s linear infinite; }
.tilde-clo[data-part="2"][data-turn="b"] .tc-button::before, .tilde-clo[data-part="3"][data-turn="b"] .tc-button::before { animation: tc-hit-b 0.6522s ease-out infinite; }
.tilde-clo[data-part="2"][data-turn="b"] .tc-button::after, .tilde-clo[data-part="3"][data-turn="b"] .tc-button::after { animation: tc-hit-glow-b 0.6522s ease-out infinite; }
@keyframes tc-bob-b { 0%, 100% { scale: 1 0.993; } 50% { scale: 1 1; } }
@keyframes tc-bob-more-b { 0%, 100% { scale: 1 0.988; } 50% { scale: 1 1; } }
@keyframes tc-sway-b { 0%, 100% { rotate: -0.6deg; } 50% { rotate: 0.6deg; } }
@keyframes tc-beat-toe-b {
  0% { background-position: 0% 0; }
  62% { background-position: 33.333% 0; }
  72% { background-position: 66.667% 0; }
  80% { background-position: 100% 0; }
  90% { background-position: 66.667% 0; }
  96% { background-position: 33.333% 0; }
}
@keyframes tc-twitch-b { 0%, 21.5% { rotate: 0deg; } 22.6% { rotate: 3deg; } 23.8% { rotate: 0deg; } 25% { rotate: 1.5deg; } 26.3%, 71.5% { rotate: 0deg; } 72.6% { rotate: -2.5deg; } 73.9%, 100% { rotate: 0deg; } }
@keyframes tc-hit-b { 0% { opacity: 1; } 100% { opacity: 0.8; } }
@keyframes tc-hit-glow-b { 0% { opacity: 0.9; } 100% { opacity: 0.4; } }
/* Less motion asked for: the still. Clo mid-breath, her "~" showing; nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .tilde-clo span, .tilde-clo .tc-button::before, .tilde-clo .tc-button::after { animation: none !important; }
}
@keyframes tc-breath {
  0% { transform: scale(1, 1); }
  2.564% { transform: scale(1.0006, 1.0013); }
  5.128% { transform: scale(1.0022, 1.0047); }
  7.692% { transform: scale(1.0046, 1.0098); }
  10.256% { transform: scale(1.0078, 1.0163); }
  12.821% { transform: scale(1.0115, 1.0241); }
  15.385% { transform: scale(1.0156, 1.0327); }
  17.949% { transform: scale(1.02, 1.0419); }
  20.513% { transform: scale(1.0245, 1.0515); }
  23.077% { transform: scale(1.0291, 1.061); }
  25.641% { transform: scale(1.0335, 1.0704); }
  28.205% { transform: scale(1.0377, 1.0792); }
  30.769% { transform: scale(1.0415, 1.0871); }
  33.333% { transform: scale(1.0447, 1.0939); }
  35.897% { transform: scale(1.0473, 1.0994); }
  38.462% { transform: scale(1.0491, 1.1031); }
  41.026% { transform: scale(1.0499, 1.1049); }
  43.59% { transform: scale(1.0498, 1.1045); }
  46.154% { transform: scale(1.0487, 1.1023); }
  48.718% { transform: scale(1.0469, 1.0986); }
  51.282% { transform: scale(1.0445, 1.0934); }
  53.846% { transform: scale(1.0415, 1.0871); }
  56.41% { transform: scale(1.038, 1.0799); }
  58.974% { transform: scale(1.0343, 1.072); }
  61.538% { transform: scale(1.0303, 1.0635); }
  64.103% { transform: scale(1.0261, 1.0548); }
  66.667% { transform: scale(1.0219, 1.0461); }
  69.231% { transform: scale(1.0178, 1.0375); }
  71.795% { transform: scale(1.0139, 1.0292); }
  74.359% { transform: scale(1.0103, 1.0216); }
  76.923% { transform: scale(1.007, 1.0148); }
  79.487% { transform: scale(1.0043, 1.009); }
  82.051% { transform: scale(1.0021, 1.0045); }
  84.615% { transform: scale(1.0007, 1.0014); }
  87.179% { transform: scale(1, 1); }
  89.744% { transform: scale(1, 1); }
  92.308% { transform: scale(1, 1); }
  94.872% { transform: scale(1, 1); }
  97.436% { transform: scale(1, 1); }
  100% { transform: scale(1, 1); }
}
@keyframes tc-ears {
  0% { transform: translate(0%, 0%); }
  2.564% { transform: translate(-0.007%, -0.446%); }
  5.128% { transform: translate(-0.025%, -1.725%); }
  7.692% { transform: translate(-0.053%, -3.84%); }
  10.256% { transform: translate(-0.089%, -6.674%); }
  12.821% { transform: translate(-0.131%, -10.076%); }
  15.385% { transform: translate(-0.178%, -13.903%); }
  17.949% { transform: translate(-0.229%, -18.027%); }
  20.513% { transform: translate(-0.281%, -22.322%); }
  23.077% { transform: translate(-0.333%, -26.658%); }
  25.641% { transform: translate(-0.383%, -30.907%); }
  28.205% { transform: translate(-0.431%, -34.937%); }
  30.769% { transform: translate(-0.475%, -38.62%); }
  33.333% { transform: translate(-0.512%, -41.826%); }
  35.897% { transform: translate(-0.541%, -44.425%); }
  38.462% { transform: translate(-0.562%, -46.288%); }
  41.026% { transform: translate(-0.571%, -47.285%); }
  43.59% { transform: translate(-0.569%, -47.328%); }
  46.154% { transform: translate(-0.557%, -46.512%); }
  48.718% { transform: translate(-0.537%, -44.945%); }
  51.282% { transform: translate(-0.509%, -42.74%); }
  53.846% { transform: translate(-0.474%, -39.996%); }
  56.41% { transform: translate(-0.435%, -36.813%); }
  58.974% { transform: translate(-0.392%, -33.287%); }
  61.538% { transform: translate(-0.346%, -29.517%); }
  64.103% { transform: translate(-0.298%, -25.601%); }
  66.667% { transform: translate(-0.251%, -21.639%); }
  69.231% { transform: translate(-0.204%, -17.729%); }
  71.795% { transform: translate(-0.159%, -13.969%); }
  74.359% { transform: translate(-0.117%, -10.458%); }
  76.923% { transform: translate(-0.08%, -7.295%); }
  79.487% { transform: translate(-0.049%, -4.578%); }
  82.051% { transform: translate(-0.024%, -2.405%); }
  84.615% { transform: translate(-0.008%, -0.875%); }
  87.179% { transform: translate(0%, -0.087%); }
  89.744% { transform: translate(0%, 0.057%); }
  92.308% { transform: translate(0%, 0.041%); }
  94.872% { transform: translate(0%, 0.008%); }
  97.436% { transform: translate(0%, -0.001%); }
  100% { transform: translate(0%, 0%); }
}
@keyframes tc-snore {
  0% { transform: translate(-67.504%, -327.978%) rotate(7.27deg); opacity: 0.276; }
  2.564% { transform: translate(-69.567%, -360.443%) rotate(8.07deg); opacity: 0.183; }
  5.128% { transform: translate(-70.079%, -392.806%) rotate(8.81deg); opacity: 0.095; }
  7.692% { transform: translate(-69.019%, -425.068%) rotate(9.46deg); opacity: 0.018; }
  10.256% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  12.821% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  15.385% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  17.949% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  20.513% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  23.077% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  25.641% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  28.205% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  30.769% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  33.333% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  35.897% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  38.462% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  41.026% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0; }
  43.59% { transform: translate(-22.524%, 385.43%) rotate(4.74deg); opacity: 0.041; }
  46.154% { transform: translate(-14.516%, 353.851%) rotate(3.87deg); opacity: 0.123; }
  48.718% { transform: translate(-6.999%, 322.218%) rotate(3.04deg); opacity: 0.214; }
  51.282% { transform: translate(-0.252%, 290.508%) rotate(2.26deg); opacity: 0.308; }
  53.846% { transform: translate(5.479%, 258.705%) rotate(1.56deg); opacity: 0.401; }
  56.41% { transform: translate(9.98%, 226.792%) rotate(0.94deg); opacity: 0.491; }
  58.974% { transform: translate(13.086%, 194.759%) rotate(0.43deg); opacity: 0.574; }
  61.538% { transform: translate(14.683%, 162.6%) rotate(0.03deg); opacity: 0.65; }
  64.103% { transform: translate(14.713%, 130.313%) rotate(-0.24deg); opacity: 0.715; }
  66.667% { transform: translate(13.174%, 97.9%) rotate(-0.38deg); opacity: 0.769; }
  69.231% { transform: translate(10.125%, 65.369%) rotate(-0.39deg); opacity: 0.81; }
  71.795% { transform: translate(5.678%, 32.731%) rotate(-0.26deg); opacity: 0.837; }
  74.359% { transform: translate(0%, 0%) rotate(0deg); opacity: 0.849; }
  76.923% { transform: translate(-6.7%, -32.805%) rotate(0.39deg); opacity: 0.847; }
  79.487% { transform: translate(-14.172%, -65.664%) rotate(0.89deg); opacity: 0.829; }
  82.051% { transform: translate(-22.14%, -98.557%) rotate(1.5deg); opacity: 0.798; }
  84.615% { transform: translate(-30.31%, -131.46%) rotate(2.2deg); opacity: 0.752; }
  87.179% { transform: translate(-38.378%, -164.351%) rotate(2.97deg); opacity: 0.695; }
  89.744% { transform: translate(-46.048%, -197.211%) rotate(3.8deg); opacity: 0.626; }
  92.308% { transform: translate(-53.035%, -230.018%) rotate(4.66deg); opacity: 0.547; }
  94.872% { transform: translate(-59.082%, -262.757%) rotate(5.54deg); opacity: 0.461; }
  97.436% { transform: translate(-63.965%, -295.414%) rotate(6.42deg); opacity: 0.37; }
  100% { transform: translate(-67.504%, -327.978%) rotate(7.27deg); opacity: 0.276; }
}
@keyframes tc-pad {
  0%, 100% { opacity: 0.8; } /* no dimmer: a dim orange pad is a brown one */
  50% { opacity: 1; }
}
@keyframes tc-glow {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.6; }
}
@keyframes tc-toe {
  0% { background-position: 0% 0; }
  36.681% { background-position: 33.333% 0; }
  37.963% { background-position: 0% 0; }
  40.313% { background-position: 33.333% 0; }
  40.598% { background-position: 66.667% 0; }
  40.883% { background-position: 100% 0; }
  41.667% { background-position: 66.667% 0; }
  41.952% { background-position: 33.333% 0; }
  42.236% { background-position: 0% 0; }
}
@keyframes tc-toe-on {
  0% { background-position: 0% 0; }
  13.889% { background-position: 33.333% 0; }
  17.735% { background-position: 0% 0; }
  24.786% { background-position: 33.333% 0; }
  25.641% { background-position: 66.667% 0; }
  26.496% { background-position: 100% 0; }
  28.846% { background-position: 66.667% 0; }
  29.701% { background-position: 33.333% 0; }
  30.556% { background-position: 0% 0; }
}
@keyframes tc-blink {
  0% { opacity: 0; }
  20.705% { opacity: 1; background-position: 0% 0; }
  21.09% { opacity: 1; background-position: 100% 0; }
  22.179% { opacity: 1; background-position: 0% 0; }
  22.692% { opacity: 0; background-position: 0% 0; }
  75.833% { opacity: 1; background-position: 0% 0; }
  76.218% { opacity: 1; background-position: 100% 0; }
  77.308% { opacity: 1; background-position: 0% 0; }
  77.821% { opacity: 0; background-position: 0% 0; }
}
