/* Welcome offer popup (a free tub for joining the waitlist), shared by the shop and the waitlist page.
   Colors come from the page: --bg for the art panel and --btn for buttons. The neutrals are set here so it
   looks the same on pages that don't define them. */
dialog.promo, .dimmer { --text: #15191d; --sub: #5d6870; --paper: #f3f3f1; --ease: cubic-bezier(.65, 0, .35, 1); }
:where(.promo) .cond { font-weight: 880; font-stretch: 72%; font-variation-settings: "wdth" 72; text-transform: uppercase; line-height: .95; letter-spacing: -.005em; }
:where(.promo) .smile { display: block; aspect-ratio: 338 / 103; background: currentColor;
  -webkit-mask: url(logos/happy-spoon-smile.png) center / contain no-repeat; mask: url(logos/happy-spoon-smile.png) center / contain no-repeat; }
:where(.promo) button { font: inherit; cursor: pointer; }
:where(.promo) .close { width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--text); display: grid; place-items: center; }
:where(.promo) .close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
:where(.promo) .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(dialog.promo) * { box-sizing: border-box; margin: 0; }
dialog.promo {
  position: fixed; inset: 0; z-index: 60; height: fit-content;
  width: min(calc(100% - 32px), 420px); max-width: none; max-height: calc(100svh - 32px); margin: auto; padding: 0; border: 0;
  border-radius: 28px; overflow: hidden; background: transparent; color: var(--text);
  display: none; flex-direction: column; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
}
dialog.promo[open] { display: flex; animation: promoIn .55s var(--ease); }
dialog.promo::backdrop { background: transparent; }
/* The dim layer behind the popup and drawer. It runs past the top and bottom of the screen so the
   areas under Safari's status bar and toolbar dim too (a dialog backdrop stops at the screen edge). */
.dimmer { position: fixed; left: 0; right: 0; top: -150px; bottom: -150px; z-index: 50; background-color: rgba(10, 12, 14, .72);   /* one solid layer: Safari only lets plain solid layers reach under its bars */ opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.dimmer.on { opacity: 1; pointer-events: auto; }
.dimmer[hidden] { display: none; }
@keyframes promoIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
/* The deal isn't tied to a flavor, so the art is just the logo (white on the page's color) */
.promo-art { position: relative; flex: 0 0 auto; height: 150px; overflow: hidden; background: var(--bg); color: #fff; display: grid; place-items: center; }
.promo-logo { display: block; width: 150px; aspect-ratio: 640 / 422; background: currentColor;
  -webkit-mask: url(logos/happy-spoon-wordmark-mask.png) center / contain no-repeat; mask: url(logos/happy-spoon-wordmark-mask.png) center / contain no-repeat; }
.promo-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 26px 24px 22px; text-align: center; background: #fff; }
.promo-x { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.9); }
.promo-kicker { margin-top: 0; font-size: 16px; line-height: 1.4; color: var(--sub); }
.promo-big { margin-top: 8px; font-size: min(72px, 17vw); line-height: .9; }
.promo-perks { list-style: none; padding: 0; margin: 16px auto 0; display: inline-flex; flex-direction: column; gap: 7px; text-align: left; font-size: 15px; font-weight: 600; }
.promo-perks li { display: flex; align-items: center; gap: 10px; }
.promo-perks li::before { content: ""; flex: 0 0 20px; height: 20px; border-radius: 50%;
  background: var(--btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.promo-fine { margin-top: 2px; font-size: 11.5px; line-height: 1.35; color: var(--sub); opacity: .85; }
.promo-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.promo-form input[type="email"] {
  width: 100%; border: 0; border-radius: 16px; padding: 17px 18px; background: var(--paper); color: var(--text); outline: none;
  font: 500 16px/1.2 "Archivo", system-ui, sans-serif; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s ease;
}
.promo-form input[type="email"]:focus { box-shadow: inset 0 0 0 2px var(--text); }
.promo-form input::placeholder { color: #8a9299; }
.promo-form button { position: relative; border: 0; border-radius: 16px; padding: 18px; background: var(--btn); color: #fff; font-size: 17px; font-weight: 800; transition: transform .15s ease; }
.promo-form button:active { transform: scale(.98); }
/* Sending: the smile draws in and wipes away on a loop (brand guide, loading and success) */
.promo-form button.sending { color: transparent; }
.promo-form button.sending::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 17px; margin: -8px 0 0 -28px; background: #fff;
  -webkit-mask: url(logos/happy-spoon-smile.png) center / contain no-repeat; mask: url(logos/happy-spoon-smile.png) center / contain no-repeat;
  animation: draw 2.4s var(--ease) infinite;
}
@keyframes draw { 0% { clip-path: inset(0 100% 0 0); } 45%, 80% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes draw-once { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.promo-note { min-height: 16px; margin-top: 6px; font-size: 13px; font-weight: 600; color: #b3261e; }
.promo-skip { margin-top: 2px; padding: 8px; border: 0; background: none; font-size: 13.5px; color: var(--sub); text-decoration: underline; text-underline-offset: 3px; }
.promo-done { display: none; flex-direction: column; align-items: center; margin-top: 18px; }
.promo.joined .promo-form-wrap, .promo.joined .promo-kicker { display: none; }
.promo.joined .promo-done { display: flex; }
/* Success: the smile draws once and stays, then the words rise in */
.promo-done .smile-draw { width: 120px; margin-top: 0; color: var(--bg); }
.promo.joined .smile-draw .smile { animation: draw-once 1s var(--ease) both; }
.promo-done b { margin-top: 16px; font-size: 34px; }
.promo.joined .promo-done b, .promo.joined .promo-done > span { animation: rise .5s .85s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.promo-done > span { margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--sub); }
.promo-shop { margin-top: 20px; width: 100%; border: 0; border-radius: 16px; padding: 17px; background: var(--paper); font-weight: 800; font-size: 16px; }

/* Short phones: a smaller picture so the form still fits */
@media (max-height: 700px) and (max-width: 899px) {
  .promo-art { height: 110px; }
  .promo-logo { width: 110px; }
  .promo-big { font-size: min(58px, 15vw); }
}

@media (min-width: 900px) {
  dialog.promo { width: min(calc(100% - 64px), 820px); flex-direction: row; min-height: 520px; }
  .promo-art { flex: 0 0 46%; height: auto; }
  .promo-logo { width: 250px; }
  .promo-body { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px 36px; }
  .promo-x { background: var(--paper); }
  .promo-big { font-size: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.promo[open], .promo *, .promo *::after { animation-duration: .01s !important; animation-delay: 0s !important; }
  .promo-form button.sending::after { animation: none; }
}
