/* Motion and tap effects. Tokens come from index.html. */

/* Buttons that wrap the hand-drawn images */
.tap{appearance:none;-webkit-appearance:none;background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;display:block;border-radius:14px;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.tap img{width:100%}
.tap:focus-visible,.count:focus-visible,.mute:focus-visible{outline:2px solid var(--wine);outline-offset:4px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
button.count{background:none;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}

/* Wobbling ink: fx.js steps the filter seed. Off with reduced motion. */
.wob-on .wob.in-view{filter:url(#wobble)}

/* Frogs, the joust hint and the tally */
.frogs-spot{position:absolute;left:max(2%,16px);bottom:44px;width:clamp(80px,12vw,120px)}
/* The hint sits under the frogs so it never touches the hero text. Always shown. */
.joust-hint{position:absolute;left:0;top:100%;margin-top:4px;white-space:nowrap;font-family:var(--script);font-size:16px;line-height:1.2;color:var(--wine);pointer-events:none;rotate:-4deg}
.tally{margin:14px 0 0;font-family:var(--hand);font-size:13px;letter-spacing:.12em;text-transform:uppercase}
.tally span{display:block;margin-bottom:2px;font-family:var(--script);font-size:16px;letter-spacing:0;text-transform:none;color:var(--wine)}
.tally b{font-family:var(--brush);font-size:22px;font-weight:400;letter-spacing:0;color:var(--wine);vertical-align:-1px}

/* Sound toggle, added by audio.js after the first sound */
.mute{position:fixed;z-index:40;left:max(12px,env(safe-area-inset-left,0px));bottom:max(12px,env(safe-area-inset-bottom,0px));font-family:var(--hand);font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink);background:var(--paper);border:1.5px solid var(--ink);border-radius:999px;padding:8px 14px;cursor:pointer}

/* Confetti and sparks */
.fx-burst{position:fixed;z-index:60;width:0;height:0;pointer-events:none}
.fx-burst i{position:absolute;left:-4px;top:-6px;width:8px;height:12px;border-radius:2px}
.fx-burst .spark{left:-7px;top:-7px;width:14px;height:14px;border-radius:0;clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%)}

/* Disco mode: a multiply layer dims the page, lighter spots act as coloured lights */
.fx-lights{position:fixed;inset:0;z-index:25;pointer-events:none;overflow:hidden;background:#aa9cc6;mix-blend-mode:multiply;opacity:0;visibility:hidden;transition:opacity .4s,visibility 0s .4s}
.disco-on .fx-lights{opacity:1;visibility:visible;transition:opacity .4s}
.fx-lights i{position:absolute;width:62vmax;height:62vmax;border-radius:50%;left:-31vmax;top:-31vmax}
.fx-lights i:nth-child(1){background:radial-gradient(circle,#fff3b8 0,rgba(255,243,184,0) 62%);translate:20vw 25vh}
.fx-lights i:nth-child(2){background:radial-gradient(circle,#ffc9de 0,rgba(255,201,222,0) 62%);translate:80vw 35vh}
.fx-lights i:nth-child(3){background:radial-gradient(circle,#bdf0ff 0,rgba(189,240,255,0) 62%);translate:35vw 80vh}
.fx-lights i:nth-child(4){background:radial-gradient(circle,#d3ffc4 0,rgba(211,255,196,0) 62%);translate:75vw 85vh}
[aria-pressed="true"].disco{animation-duration:1.2s}

@media (max-width:640px){
  /* Frogs join the normal flow under the countdown, so they never cover the date */
  .frogs-spot{position:relative;left:auto;bottom:auto;width:108px;margin:30px auto 30px}
  .joust-hint{left:50%;translate:-50% 0}
}

@media (prefers-reduced-motion:no-preference){
  .joust-hint{animation:hint 1.6s ease-in-out infinite}
  @keyframes hint{0%,100%{rotate:-6deg}50%{rotate:-1deg}}
  .tap:not(.couple):not(.footer-banner):active img{scale:.97}
  .footer-banner:active img{scale:.995}
  .popped img{animation:popped .38s ease-out}
  @keyframes popped{0%{translate:0 0}30%{translate:0 3px}65%{translate:0 -2px}100%{translate:0 0}}
  .disco-on .fx-lights i:nth-child(1){animation:spot-a 7s ease-in-out infinite alternate}
  .disco-on .fx-lights i:nth-child(2){animation:spot-b 9s ease-in-out infinite alternate}
  .disco-on .fx-lights i:nth-child(3){animation:spot-b 6s ease-in-out infinite alternate-reverse}
  .disco-on .fx-lights i:nth-child(4){animation:spot-a 8s ease-in-out infinite alternate-reverse}
  @keyframes spot-a{0%{translate:5vw 10vh}50%{translate:90vw 45vh}100%{translate:30vw 95vh}}
  @keyframes spot-b{0%{translate:95vw 15vh}50%{translate:15vw 55vh}100%{translate:80vw 90vh}}
}
