/* The customer site: the other pages (/h/, /thanks/, the 404). Build step 5, session 56; polished Nov 17, about 9:47 p.m.
   Loaded after site.css, so every token and component (grounds, notes, buttons, eyebrow, the straw rule, the stage light) comes from there.
   On top: the hand that flips (/h/: a row on wide screens, a hand on phones; /thanks/: the hand at three), its names, the cracked card, the pink note.
   Colours and sizes from tokens only (SYSTEM.md §1). Motion only what acts out the game: a card turns, a card is dealt, a card cracks (once), the next card nudges. */

.reveal,.nf{padding:calc(var(--sec-y) * .55) 0 var(--sec-y);text-align:center}
.thanks{padding:calc(var(--sec-y) * .55) 0 calc(var(--sec-y) * 1.1);text-align:center}
.reveal .lead,.thanks .lead,.nf .lead{margin:0 auto 10px}
.reveal h1{max-width:16ch;margin-inline:auto}
.reveal h1 .pay{display:block}

/* ---------- the hand: face down until turned; --i is the card's place, --n how many ---------- */
.rrow{--cw:clamp(80px,11.5vw,140px);--fan:9deg;display:flex;justify-content:center;gap:16px;margin:34px auto 22px;padding:0;list-style:none}
.rcard{position:relative;flex:none;width:var(--cw)}
.rcard:nth-child(odd){rotate:-2deg}
.rcard:nth-child(even){rotate:1.6deg}
.rflip{position:relative;display:block;width:100%;aspect-ratio:420/588;padding:0;border:0;border-radius:8px;background:none;color:inherit;cursor:pointer;perspective:900px;-webkit-tap-highlight-color:transparent}
.rflip img{position:absolute;inset:0;width:100%;height:100%;border-radius:8px;box-shadow:var(--sh-card);backface-visibility:hidden;-webkit-backface-visibility:hidden;transition:transform .55s var(--ease),box-shadow .3s}
.rflip .face{transform:rotateY(180deg)}
.rcard.up .rflip .back{transform:rotateY(-180deg)}
.rcard.up .rflip .face{transform:rotateY(0deg)}
.rcard.up .rflip,span.rflip{cursor:default}
.rcard.next .rflip .back{box-shadow:0 0 0 4px var(--mustard),var(--sh-card)}
.js .rcard.next .rflip{animation:nudge 1.6s ease-in-out infinite}
.rtag{position:absolute;z-index:2;left:-12%;bottom:9%;padding:5px 7px;background:var(--note);color:var(--t-ink);font-family:var(--label);font-variation-settings:normal;font-weight:800;font-size:var(--fs-label-s);letter-spacing:1.3px;line-height:1;text-transform:uppercase;white-space:nowrap;rotate:var(--tilt-tag);box-shadow:var(--sh-tag);pointer-events:none}

/* its names, in order, as the foot's handcap; a face-down card's name is a mark until it turns */
.rnames{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;max-width:980px;margin:0 auto 8px;padding:0;list-style:none}
.rnames li{font-weight:800;font-size:var(--fs-handcap);line-height:1.2;transition:opacity .3s}
.rnames b{margin-right:4px;font-family:var(--display);font-weight:400;font-variation-settings:normal;color:var(--t-mustard)}
.g-paper .rnames b{color:var(--t-red)}
.rnames li.hid{opacity:.5}
.say{min-height:1.4em;margin:6px auto 30px;color:var(--t-mustard)}

/* the end of the reveal: what the game is, on a mint note, beside the one button */
.rend{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:30px 48px}
.what{flex:0 1 440px;padding:20px 24px 18px;text-align:left;rotate:-1.2deg}
.what b{font-family:var(--display);font-weight:400;font-variation-settings:normal;font-size:var(--fs-h3);line-height:1.05}
.what p{margin:6px 0 0;font-weight:700;font-size:var(--fs-lead)}
.rgo{display:flex;flex-direction:column;align-items:center;gap:14px}
.privacy{max-width:34ch;margin:0 auto;color:var(--t-dim)}
.g-paper .privacy{color:var(--t-ink2)}

/* a phone holds the seven as a hand, like the foot's: any tap still turns the next one */
@media (max-width:699px){
  .reveal .rrow{--cw:clamp(84px,24vw,118px);position:relative;display:block;width:100%;height:calc(var(--cw) * 1.4 + 14px);margin:30px auto calc(var(--cw) * .5)}
  .reveal .rcard{position:absolute;left:50%;bottom:0;margin-left:calc(var(--cw) / -2);transform-origin:50% 135%;rotate:calc((var(--i) - (var(--n) - 1) / 2) * var(--fan))}
  .reveal .rtag{display:none}
}

/* ---------- /thanks/: "You're in", the hand at three, dealt (no print-and-play: backers only) ---------- */
.thanks h1{margin:0 auto}
.thanks h1 .pay{display:inline}
.tgive{margin-top:calc(var(--sec-y) * .4)}
.thanks h2{max-width:18ch;margin-inline:auto}
.thanks .lead{max-width:34ch}
.rrow.three{--cw:clamp(100px,17vw,170px);--fan:12deg;position:relative;display:block;width:100%;height:calc(var(--cw) * 1.4 + 14px);margin:34px auto calc(var(--cw) * .36)}
.rrow.three .rcard{position:absolute;left:50%;bottom:0;margin-left:calc(var(--cw) / -2);transform-origin:50% 135%;rotate:calc((var(--i) - (var(--n) - 1) / 2) * var(--fan))}
.rrow.three .rtag{display:none}
.js .rrow.three.dealt .rcard{animation:land .6s var(--hit) both;animation-delay:calc(var(--i) * 110ms)}
.acts{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:14px 18px;margin:22px auto 18px}
.acts .copied{flex-basis:100%;min-height:1.2em;margin:0}
.g-paper .copied{color:var(--t-redink)}

/* ---------- 404: a card back cracks in two, once, under the stage light; the line on a torn note ---------- */
.nf{padding-top:calc(var(--sec-y) * .7)}
.crack{position:relative;width:clamp(110px,15vw,150px);aspect-ratio:420/588;margin:0 auto 38px;rotate:-5deg;filter:var(--sh-tuck)}
.crack img{position:absolute;inset:0;width:100%;height:100%;border-radius:8px;transform-origin:50% 100%}
.crack .c1{clip-path:polygon(0 0,57% 0,47% 19%,61% 37%,45% 56%,58% 74%,48% 100%,0 100%);translate:-8px 0;rotate:-6deg}
.crack .c2{clip-path:polygon(57% 0,100% 0,100% 100%,48% 100%,58% 74%,45% 56%,61% 37%,47% 19%);translate:8px -4px;rotate:6deg}
@keyframes crackL{from{translate:0 0;rotate:0deg}}
@keyframes crackR{from{translate:0 0;rotate:0deg}}
.js .crack .c1{animation:crackL .5s var(--hit) .4s both}
.js .crack .c2{animation:crackR .5s var(--hit) .4s both}
.nfnote{max-width:620px;margin:0 auto 28px;padding:24px clamp(20px,3vw,32px) 22px;rotate:-1.6deg}
.nfnote h1{margin:0;color:var(--t-ink)}
.nfnote h1 em{display:block;font-style:normal;color:var(--t-red)}
.nf .lead{max-width:30ch}
.nf .acts{margin-top:26px}

@media (prefers-reduced-motion:reduce){
  .rflip img{transition:none}
  .js .rcard.next .rflip{animation:none}
}
