/* The visitor's own hands (js/hands.js), the step dots and the quiet line, shared by the worship hall
   and the water basin. */

/* ---------- step dots ---------- */
.steps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; height: 10px; flex: none; }
.steps li {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid #e2dbf6;
  transition: background .3s, border-color .3s, width .3s;
}
.steps li.past { background: var(--lilac); border-color: var(--lilac-deep); }
.steps li.on { width: 24px; border-radius: 999px; background: var(--gold-1); border-color: var(--gold-2); }

/* ---------- a quiet line under the hint ("You prayed here today", the kind line) ---------- */
.quiet { margin: -2px 0 0; padding: 0 10px; text-align: center; text-wrap: balance; font-size: 13.5px; line-height: 1.3; color: var(--ink-soft); }
.quiet.kind { font-size: 15px; color: var(--coral-ink); font-weight: 600; animation: hintIn .5s cubic-bezier(.3, 1.4, .5, 1); }
/* narrow phones: a little smaller, so a two-line kind line stays clear of the season button in the corner */
@media (max-width: 360px) { .quiet.kind { font-size: 13.5px; } }

/* ---------- the hands ---------- */
.hands {
  position: absolute; z-index: 2; left: 50%; translate: -50% 0;
  bottom: calc(-10px - env(safe-area-inset-bottom));
  width: min(272px, 74%); aspect-ratio: 300 / 150;
  outline: none; touch-action: none;
}
.hands:focus-visible { outline: none; }   /* the hint says what to do; a ring round the hands would only be noise */
.hands-art { position: relative; width: 100%; height: 100%; overflow: visible; }
.hand-in {
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform .5s cubic-bezier(.3, 1.25, .5, 1);
}
.hands[data-pose="hidden"] .hand-in { transform: translate(0, 120%) rotate(8deg); transition-timing-function: cubic-bezier(.5, 0, .7, .4); transition-duration: .35s; }
/* at rest: held out in front, forearms coming up from the bottom corners, so the fingertips lean a
   little toward the middle (the right hand is the mirror image) */
.hands[data-pose="rest"] .hand-in { transform: translate(-6px, 2px) rotate(7deg); }
.hands[data-pose="open"] .hand-in { transform: translate(10px, -4px) rotate(4deg); }
.hands[data-pose="together"] .hand-in, .hands[data-pose="low"] .hand-in { transform: translate(24px, -8px) rotate(0); }
.hands[data-pose="low"] .hand-in { transform: translate(24px, 26px) rotate(0); }
/* a short phone: the finished screen's kind line can wrap to two lines; the hands sink a little more under it */
@media (max-height: 620px) { .hands[data-pose="low"] .hand-in { transform: translate(24px, 47px) rotate(0); } }
.hands.fast .hand-in { transition-duration: .15s; transition-timing-function: cubic-bezier(.6, 0, .9, .5); }
/* the hand being rinsed comes forward (up and a little bigger), under the ladle */
.hands.fwd-l .hand-in.l, .hands.fwd-r .hand-in.r { transform: translate(-8px, -8px) rotate(3deg) scale(1.08); }
.hd-body { transform-box: fill-box; transform-origin: 50% 100%; }

.hd-skin-o > * { fill: #f2b8a4; stroke: #f2b8a4; stroke-width: 4.4; stroke-linejoin: round; }
.hd-skin > * { fill: #ffe6da; }
.hd-nail { fill: #fff3ee; stroke: #f6cfc1; stroke-width: 1; }
.hd-knuckle { fill: none; stroke: #f5c9b8; stroke-width: 1.6; stroke-linecap: round; }
.hd-shine { fill: none; stroke: #fff6f1; stroke-width: 3.4; stroke-linecap: round; opacity: .9; }
.hd-thumb { fill: #ffe6da; stroke: #f2b8a4; stroke-width: 2.2; stroke-linejoin: round; }
.hd-far .hd-skin > * { fill: #fcdccf; }   /* the far hand, behind: a touch deeper so the seam reads */
.hd-crease { fill: none; stroke: #f2c3b2; stroke-width: 1.8; stroke-linecap: round; }
.hd-shine-s { fill: none; stroke: #fff6f1; stroke-width: 2.2; stroke-linecap: round; opacity: .9; }
.hd-sleeve { fill: #d9d0ff; stroke: #b9acf0; stroke-width: 2.2; stroke-linejoin: round; }
.hd-lining { fill: none; stroke: #fff1f4; stroke-width: 4; stroke-linecap: round; }
.hd-fold { fill: none; stroke: #c6bbf6; stroke-width: 1.8; stroke-linecap: round; }
/* the back of the hand at rest; the pressed hands seen from the side (gassho) when they come together */
.hd-back, .hd-side { transition: opacity .22s ease-out; }
.hd-side { opacity: 0; }
.hands[data-pose="together"] .hd-back, .hands[data-pose="low"] .hd-back { opacity: 0; }
.hands[data-pose="together"] .hd-side, .hands[data-pose="low"] .hd-side { opacity: 1; }
.hands.fast .hd-back, .hands.fast .hd-side { transition-duration: .1s; }
/* rinsed (hands.js wet(), WET_MS = 2.1 s): the stream lands on the back of the hand, a clear sheet of
   water spreads from there over the whole hand (fingers and thumb too), runnels run between the
   fingers and down the sides, drops fall from the fingertips and the wrist side, then the sheet dries
   and a few beads stay a moment longer */
.hd-water { opacity: 0; pointer-events: none; }
.hd-sheet { opacity: .52; }
.hd-sheet > * { fill: #f2fbff; }
.hd-halo { opacity: 0; }
.hd-halo > * { fill: #b5e3f7; stroke: #b5e3f7; stroke-width: 12; stroke-linejoin: round; }
.hd-run { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 10 9; opacity: .9; }
.hd-water-hi { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .95; }
.hd-drop { fill: #d4effa; stroke: #8fcbe6; stroke-width: 1.1; opacity: 0; transform-box: fill-box; transform-origin: 50% 0; }
.hd-bead { fill: rgba(212, 239, 250, .9); stroke: #9fd3ea; stroke-width: .9; }
.hd-bead-hi { fill: #fff; }
.hd-beads { opacity: 0; }
.hd-aim { fill: none; }
.hand-in.wet .hd-water { opacity: 1; }
.hand-in.wet .hd-sheet { animation: wetSheet 2.1s ease-out both; }
.hand-in.wet .hd-halo { animation: wetHalo 2.1s ease-out both; }
.hand-in.wet .hd-run { animation: wetRun 2.1s linear both; }
.hand-in.wet .hd-water-hi { animation: wetHi 2.1s ease-out both; }
.hand-in.wet .hd-drop { animation: wetDrip .7s ease-in 2 both; }
.hand-in.wet .hd-beads { animation: wetBeads 2.1s linear both; }
@keyframes wetSheet {
  0% { clip-path: circle(0% at 44% 52%) fill-box; opacity: .5; }
  24% { clip-path: circle(80% at 44% 52%) fill-box; opacity: .5; }
  66% { clip-path: circle(80% at 44% 52%) fill-box; opacity: .45; }
  100% { clip-path: circle(80% at 44% 52%) fill-box; opacity: 0; }
}
@keyframes wetHalo {
  0% { clip-path: circle(0% at 44% 52%) fill-box; opacity: 1; }
  24% { clip-path: circle(80% at 44% 52%) fill-box; opacity: 1; }
  66% { clip-path: circle(80% at 44% 52%) fill-box; opacity: .9; }
  100% { clip-path: circle(80% at 44% 52%) fill-box; opacity: 0; }
}
@keyframes wetRun { 0%, 12% { opacity: 0; stroke-dashoffset: 0; } 22% { opacity: .9; } 70% { opacity: .9; } 86%, 100% { opacity: 0; stroke-dashoffset: -60; } }
@keyframes wetHi { 0%, 14% { opacity: 0; } 26%, 70% { opacity: .95; } 100% { opacity: 0; } }
@keyframes wetDrip {
  0% { opacity: 0; transform: translateY(-2px) scale(.4); }
  25% { opacity: 1; transform: translateY(0) scale(1, 1.15); }
  100% { opacity: 0; transform: translateY(30px) scale(.8, 1.2); }
}
@keyframes wetBeads { 0%, 50% { opacity: 0; } 62%, 88% { opacity: 1; } 100% { opacity: 0; } }

/* the glow of a wish, behind the hands */
.hands-glow {
  position: absolute; left: 50%; top: 22%; width: 120%; aspect-ratio: 1.2; border-radius: 50%;
  transform: translate(-50%, -50%) scale(.35); opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, #fffbe6 0, rgba(255, 240, 186, .95) 35%, rgba(255, 214, 200, .55) 65%, rgba(255, 214, 200, 0) 100%);
}

/* the little sparkles of hands.js: water drops */
.sparkle.drop { clip-path: none; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #d4effa; filter: drop-shadow(0 0 2px #a9d9ec); }

@media (prefers-reduced-motion: reduce) {
  .hand-in, .steps li { transition: none !important; }
  /* rinsed: the wet hand shows (sheet, shine, a few drops and beads) without moving, then dries */
  .quiet.kind, .hand-in.wet .hd-sheet, .hand-in.wet .hd-halo, .hand-in.wet .hd-run, .hand-in.wet .hd-water-hi, .hand-in.wet .hd-drop, .hand-in.wet .hd-beads { animation: none !important; }
  .hand-in.wet .hd-drop, .hand-in.wet .hd-beads, .hand-in.wet .hd-halo { opacity: 1; }
  .hd-back, .hd-side { transition: none !important; }
}
/* at the hall the hands take no taps themselves (a tap anywhere is a bow / clap / wish): the ¥5 under them stays tappable */
.hd-controls .hands { pointer-events: none; }
/* the hint, the dots and the line stay in front of the wish's glow */
.hd-controls .hint, .hd-controls .steps, .hd-controls .quiet, .tz-controls .hint, .tz-controls .steps, .tz-controls .quiet { position: relative; z-index: 3; }
