/* Two-card drop. Rewritten from the Da Maria Webflow template (IX2 a-186 "Reserve Card [IN]" / a-196 "Reserve Card [OUT]",
   on the nav's RESERVE stamp; clone + numbers: ~/Dev/damaria-recreate/PARTS.md).

   <div class="tcd" id="book">                    the dialog: two loose paper cards + a veil
     <div class="tcd-veil"></div>
     <div class="tcd-cards"><div class="tcd-top"> ... <button class="tcd-close"> ...</div><div class="tcd-bottom"> ... </div></div>
   </div>
   <button data-tcd-open="book">Reserve</button>

   A booking dialog made of two separate cards (a heading card and a form card) that land like two slips of paper
   dropped on the page: each starts a few rem low (3rem / 4rem), turned the opposite way (-5deg / +5deg) and invisible,
   and settles flat, the bottom card 30ms behind the top one. One curve for everything, cubic-bezier(.62,.08,0,1): a
   held breath then a fast, soft landing. Top card: opacity 500ms, rotation + drop 750ms. Bottom card (+30ms): drop
   750ms, rotation + opacity 500ms, so it is already straight while it is still sliding into place. The veil
   (grey #464646 at 50%) fades in over the same 750ms.
   Out is the reverse, quicker: the bottom card goes first (500ms drop + turn, 400ms fade), the top card follows 40ms
   later; the veil fades over 500ms; then the dialog is hidden. */
.tcd {
  --tcd-ease: cubic-bezier(.62, .08, 0, 1);
  --tcd-top-y: 3rem;   --tcd-top-turn: -5deg;
  --tcd-bot-y: 4rem;   --tcd-bot-turn: 5deg;
  --tcd-lag: 30ms;      /* bottom card behind the top one, opening */
  --tcd-lag-out: 40ms;  /* top card behind the bottom one, closing */
  --tcd-veil: rgba(70, 70, 70, .5);
  position: fixed; inset: 0; z-index: 100; display: none;
}
.tcd.is-shown { display: block; }
.tcd-veil { position: absolute; inset: 0; background: var(--tcd-veil); opacity: 0; transition: opacity 500ms var(--tcd-ease); }
.tcd-cards { position: relative; z-index: 1; filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, .15)); }
.tcd-top, .tcd-bottom { position: relative; opacity: 0; }
.tcd-top {
  translate: 0 var(--tcd-top-y); rotate: var(--tcd-top-turn);
  transition: opacity 400ms var(--tcd-ease), translate 500ms var(--tcd-ease) var(--tcd-lag-out), rotate 500ms var(--tcd-ease) var(--tcd-lag-out);
}
.tcd-bottom {
  translate: 0 var(--tcd-bot-y); rotate: var(--tcd-bot-turn);
  transition: opacity 400ms var(--tcd-ease), translate 500ms var(--tcd-ease), rotate 500ms var(--tcd-ease);
}
.tcd.is-open .tcd-veil { opacity: 1; transition-duration: 750ms; }
.tcd.is-open .tcd-top {
  opacity: 1; translate: none; rotate: none;
  transition: opacity 500ms var(--tcd-ease), translate 750ms var(--tcd-ease), rotate 750ms var(--tcd-ease);
}
.tcd.is-open .tcd-bottom {
  opacity: 1; translate: none; rotate: none;
  transition: opacity 500ms var(--tcd-ease) var(--tcd-lag), translate 750ms var(--tcd-ease) var(--tcd-lag), rotate 500ms var(--tcd-ease) var(--tcd-lag);
}
@media (prefers-reduced-motion: reduce) {
  .tcd *, .tcd.is-open * { transition-duration: 0s !important; transition-delay: 0s !important; }
}
