/* A gift, opened: a quiet dark room with nothing in it but the envelope, the card and the open card. The envelope, the front and the
   open card themselves are drawn in word.css; this file is the room around them and the way they move. */
.dgwx-body { margin: 0; background: #0E1511; }
.dgwx { max-width: none; margin: 0; padding: 0; min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden; color: #F6EFDF;
  background: radial-gradient(120% 85% at 50% 36%, #31493A 0%, #1B2A20 48%, #0E1511 100%); }
.dgwx::before { content: ""; position: absolute; left: 50%; top: 42%; width: min(980px, 150vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(232, 184, 75, .22), rgba(232, 184, 75, 0)); pointer-events: none; }
#dgwx-sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dgwx #dgwg-gift { position: relative; max-width: none; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: 40px 18px 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dgwx #dgwg-gift[data-stage="open"] { justify-content: flex-start; padding-top: 44px; }
.dgwx .dgwg-stage { width: 100%; gap: 28px; padding: 0; animation: dgwx-in .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes dgwx-in { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.dgwx-hello { margin: 0; max-width: 18em; text-align: center; font: 500 clamp(1.45rem, 4.6vw, 2.2rem)/1.2 Fraunces, Georgia, serif; color: #F6EFDF; }

/* the envelope floats; the card waits behind it and rises out when it is opened */
.dgwx-env { position: relative; display: block; width: min(86vw, 470px); border: 0; padding: 0; background: none; cursor: pointer;
  animation: dgwx-float 5s ease-in-out infinite; }
@keyframes dgwx-float { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-10px) rotate(.8deg); } }
.dgwx-env .dgwg-env { z-index: 1; max-width: none; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); transition: transform .6s ease .35s, opacity .6s ease .35s; }
.dgwx-peek { position: absolute; left: 50%; top: 4%; width: 46%; transform: translateX(-50%); font-size: .62rem; text-align: start;
  transition: transform .75s cubic-bezier(.2, .8, .2, 1); }
.dgwx-env.is-open { animation: none; }
.dgwx-env.is-open .dgwx-peek { transform: translate(-50%, -62%); }
.dgwx-env.is-open .dgwg-env { transform: translateY(28%) rotate(-3deg); opacity: 0; }

/* while the envelope or the card moves, the words and the button around it step back */
.dgwx-hello, .dgwx-go { transition: opacity .3s ease; }
.is-leaving .dgwx-hello, .is-leaving .dgwx-go { opacity: 0; }

/* the one thing to do next is always a gold button with a slow ring around it */
.dgwx-go { font-size: 1.1rem; padding: 16px 32px; animation: dgwx-ring 2.2s ease-out infinite; }
@keyframes dgwx-ring { 0% { box-shadow: 0 0 0 0 rgba(232, 184, 75, .55); } 70%, 100% { box-shadow: 0 0 0 18px rgba(232, 184, 75, 0); } }

/* the card: light passes over it now and then, and it swings away when it is opened */
.dgwx .dgwg-card-btn { width: min(78vw, 400px, 44vh); transform-origin: left center; transition: transform .42s ease-in, opacity .42s ease-in; }
.dgwx .dgwg-card-btn .dgwg-front { box-shadow: 0 34px 70px rgba(0, 0, 0, .55); }
.dgwx .dgwg-card-btn .dgwg-front::after { content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, 0) 62%);
  animation: dgwx-shine 4s ease-in-out 1s infinite; }
@keyframes dgwx-shine { 0% { transform: translateX(-130%); } 35%, 100% { transform: translateX(130%); } }
.dgwx .dgwg-card-btn.is-open { transform: perspective(1200px) rotateY(-86deg); opacity: .15; }

/* the open card, and under it what a reader can do */
.dgwx .dgwg-stage-open { animation: dgwx-unfold .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes dgwx-unfold { from { opacity: 0; transform: perspective(1400px) rotateY(24deg) scale(.96); } to { opacity: 1; transform: none; } }
.dgwx .dgwg-open { max-width: 640px; box-shadow: 0 40px 90px rgba(0, 0, 0, .55); }
/* the demo of the shop: a small mark that it is an example, and a line under the card */
.dgwx-demo { position: absolute; top: 14px; left: 50%; z-index: 5; transform: translateX(-50%); margin: 0; padding: 5px 14px; border-radius: 999px;
  background: var(--gold); color: #1B2019; font: 600 .64rem Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.dgwx-demo-p { margin: 0; max-width: 26em; color: #F6EFDF; }
.dgwx-after { display: grid; gap: 12px; justify-items: center; text-align: center; margin: 6px 0 0; }
.dgwx .dgwg-half { color: #C9C2B0; margin: 0; }
.dgwx .dgwg-remove .dgwg-link { color: #9FA79F; margin: 0 8px; }
.dgwx-brand { position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; text-align: center; font: 600 .64rem Inter, sans-serif; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(246, 239, 223, .42); }
.dgwx .dgwg-center h1, .dgwx .dgwg-center .dgwg-lead { color: #F6EFDF; }

@media (min-width: 980px) {
  /* on a wide screen the card lies open as a card does: the giver's words on the left, the study on the right */
  .dgwx .dgwg-open { max-width: 1040px; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .dgwx .dgwg-left { border-bottom: 0; border-inline-end: 1px solid #E4DBC6; justify-content: flex-start; padding: 44px 44px; font-size: 1.9rem; }
  .dgwx .dgwg-cover { display: block; width: 62%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; margin: 0 auto 26px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .25); }
  .dgwx .dgwg-right { padding: 46px 48px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .dgwx *, .dgwx *::after { animation: none !important; transition: none !important; }
}
