/* Festive Manchester · stage.css · the gift-tag stage
   Loaded after base.css on every page that is built as a gift tag hanging
   over a snowy, lit stage: the front page and the sign-in page. base.css
   supplies the tokens, fonts, header, buttons, garland, twinkles and footer;
   this file adds the stage (snow, baubles, two trees) and the tag itself
   (the card, its trimmings, its words, the fields and the button). A page's
   own stylesheet (home.css, login.css) adds only what is its own. The desktop
   design comes first in rem, so it scales with the root on large screens;
   tablets and phones follow, with the homepage's breakpoints. */


:root {
  --tag-w: 27rem;      /* the tag's width */
  --tag-h: 31.5rem;    /* its height at rest: sets how long the thread can be */
}

/* ---------- Page and stage ---------- */

.stage-page {
  background: var(--night);
}

/* The header shows from the first paint; the class only hands it back to the
   homepage's normal styling (as on the tree chooser). */
html.js .stage-page .site-header:not(.is-in) {
  opacity: 1;
  transform: none;
}

.stage {
  /* The thread grows with the window, so the tag hangs near the middle of a
     tall screen and tucks up under the lights on a short one. */
  --tag-drop: clamp(2.25rem, calc((100vh - 4.875rem - var(--tag-h)) * 0.4), 9rem);
  /* The clear space either side of the tag, held to its 1440px size on very
     wide screens so the trees and baubles stay gathered round the tag. */
  --side: min(calc((100% - var(--tag-w)) / 2), 31.5rem);
  --tree-h: min(34rem, 58vh, 34vw);
  /* The half of the garland that hangs above the seam. The stage runs this
     far past the first screen, so the garland waits just below the fold and
     is never seen cut in two. */
  --seam: calc(min(100vw, 110rem) * 0.069 + 0.5rem);
  position: relative;
  min-height: calc(100vh + var(--seam));
  padding: calc(4.875rem + var(--tag-drop)) 0 calc(var(--seam) + 4rem);
  background:
    radial-gradient(ellipse 30% 36% at 50% 40%, rgba(226, 180, 96, 0.15) 0%, rgba(226, 180, 96, 0) 70%),
    radial-gradient(ellipse 58% 66% at 50% 42%, #1f4432 0%, rgba(31, 68, 50, 0) 70%),
    linear-gradient(180deg, var(--night) 0%, var(--evergreen) 38%, var(--evergreen) 100%);
  overflow-x: clip;
}

.stage__inner {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
}

/* The garland hangs across the seam into the footer, as on the homepage. */
.stage__garland {
  bottom: 0;
  transform: translateY(50%);
}

.stage-page .site-footer__inner,
.stage-page .site-footer__plain {
  padding-top: 8.5rem;
}

/* ---------- Falling snow ----------
   stage.js adds the flakes once and never touches them again: each is a
   hair-thin column the height of the stage with a dot at its top, so one
   compositor-only animation carries it from top to bottom, and a second
   sways it. Nothing is drawn per frame. */

.stage__snow {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  animation: stage-fade 0.9s ease-out backwards;
}

.stage__snow i {
  position: absolute;
  top: 0;
  width: var(--size);
  height: 100%;
  translate: 0 -2%;
  animation:
    stage-snow-fall var(--fall) linear var(--delay) infinite,
    stage-snow-sway 4.36s ease-in-out var(--sway-delay) infinite alternate;
  will-change: translate, transform;
}

.stage__snow i::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 252, 245, var(--alpha));
}

@keyframes stage-snow-fall {
  from {
    translate: 0 -2%;
  }

  to {
    translate: 0 100%;
  }
}

@keyframes stage-snow-sway {
  from {
    transform: translateX(calc(var(--sway) * -1));
  }

  to {
    transform: translateX(var(--sway));
  }
}

@keyframes stage-fade {
  from {
    opacity: 0;
  }
}

/* Nothing decorative moves while the stage is out of view. */
.stage.is-offstage .stage__snow i,
.stage.is-offstage .bauble,
.stage.is-offstage .twinkle,
.stage.is-offstage .gift-tag__sparkle {
  animation-play-state: paused;
}

/* ---------- Baubles ----------
   Three each side on gold threads, longest at the outside, so they open like
   a curtain round the tag. They hang from behind the header's hem. */

.stage__baubles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.bauble {
  --f: 0.5;          /* how far out from the tag, as a share of the side space */
  --drop: 6rem;      /* the thread's length */
  --size: 2.25rem;
  position: absolute;
  top: 4.375rem;
  width: var(--size);
  margin: 0 calc(var(--size) / -2);
  transform-origin: 50% 0;
  animation:
    bauble-in 0.9s cubic-bezier(0.34, 1.2, 0.64, 1) var(--in, 0.4s) backwards,
    bauble-sway var(--swing, 5s) ease-in-out var(--swing-delay, 0s) infinite alternate;
}

.bauble--left {
  left: calc(50% - var(--tag-w) / 2 - var(--side) * var(--f));
}

.bauble--right {
  right: calc(50% - var(--tag-w) / 2 - var(--side) * var(--f));
}

.bauble--outer {
  --f: 0.84;
  --drop: 10rem;
  --size: 2.875rem;
  --swing: 5.6s;
  --in: 0.75s;
}

.bauble--middle {
  --f: 0.53;
  --drop: 6rem;
  --size: 2.125rem;
  --swing: 4.7s;
  --swing-delay: -1.9s;
  --in: 0.6s;
}

.bauble--inner {
  --f: 0.22;
  --drop: 2.75rem;
  --size: 1.625rem;
  --swing: 4.1s;
  --swing-delay: -3.1s;
  --in: 0.45s;
}

/* The two sides swing out of step, so the row never moves as one. */
.bauble--right {
  animation-direction: normal, alternate-reverse;
}

/* The thread. */
.bauble::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: var(--drop);
  margin-left: -0.5px;
  background: linear-gradient(180deg, rgba(217, 178, 106, 0.15), rgba(217, 178, 106, 0.85) 45%);
}

/* The ball, with its cap and the loop the thread ties to. */
.bauble i {
  position: relative;
  display: block;
  width: var(--size);
  height: var(--size);
  margin-top: calc(var(--drop) + var(--size) * 0.2);
  border-radius: 50%;
}

.bauble i::before {
  content: "";
  position: absolute;
  bottom: 96%;
  left: 50%;
  width: 30%;
  height: 15%;
  margin-left: -15%;
  border-radius: 25% 25% 10% 10%;
  background: linear-gradient(90deg, #8a6526 0%, #f1d59b 45%, #a97f3f 100%);
}

.bauble i::after {
  content: "";
  position: absolute;
  bottom: 108%;
  left: 50%;
  width: 14%;
  height: 14%;
  margin-left: -7%;
  border: 1px solid var(--gold);
  border-radius: 50%;
}

.bauble--gold i {
  background: radial-gradient(circle at 32% 28%, #fffbe9 0%, #f6dfa6 12%, #d9b26a 44%, #a97f3f 76%, #775621 100%);
  box-shadow: 0 0 1.5rem rgba(241, 190, 100, 0.3), inset -0.1em -0.16em 0.4em rgba(60, 35, 5, 0.4);
}

.bauble--berry i {
  background: radial-gradient(circle at 32% 28%, #ffd9dc 0%, #d9566a 12%, #a52a3c 42%, #6b1a2a 74%, #3d0c17 100%);
  box-shadow: 0 0 1.25rem rgba(184, 50, 63, 0.3), inset -0.1em -0.16em 0.4em rgba(30, 4, 10, 0.5);
}

.bauble--ivory i {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #fbf5ea 22%, #e6d9c0 58%, #b8a37a 100%);
  box-shadow: 0 0 1.25rem rgba(247, 240, 228, 0.22), inset -0.1em -0.16em 0.4em rgba(70, 50, 20, 0.35);
}

@keyframes bauble-in {
  from {
    opacity: 0;
    translate: 0 -2.5rem;
  }
}

@keyframes bauble-sway {
  from {
    transform: rotate(-2.4deg);
  }

  to {
    transform: rotate(2.4deg);
  }
}

/* ---------- The two trees ----------
   The pre-lit fir from the shop, one either side like the pair beside a front
   door. A few of its lights twinkle (the hero's twinkles, placed by hand). */

.stage__tree {
  position: absolute;
  bottom: calc(var(--seam) + 2.75rem);
  z-index: 1;
  width: calc(var(--tree-h) * 0.75);
  height: var(--tree-h);
  pointer-events: none;
  animation: stage-tree-in 1.6s ease-out 0.3s backwards;
}

.stage__tree--left {
  left: calc(50% - var(--tag-w) / 2 - var(--side) / 2);
  margin-left: calc(var(--tree-h) * -0.375);
}

.stage__tree--right {
  right: calc(50% - var(--tag-w) / 2 - var(--side) / 2);
  margin-right: calc(var(--tree-h) * -0.375);
  transform: scaleX(-1);
}

/* Warm light behind each tree, and its shadow on the floor. */
.stage__tree::before {
  content: "";
  position: absolute;
  inset: 4% -10% 2%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(241, 200, 120, 0.2), rgba(241, 200, 120, 0));
}

.stage__tree::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 1.5%;
  height: 5%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
}

.stage__tree img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage__tree .twinkle {
  z-index: 2;
  width: 0.875rem;
  height: 0.875rem;
  margin: -0.4375rem 0 0 -0.4375rem;
}

@keyframes stage-tree-in {
  from {
    opacity: 0;
    translate: 0 1.25rem;
  }
}

/* ---------- The tag ---------- */

/* The drop: the tag comes down from under the lights, then settles. */
.stage__hang {
  width: 100%;
  max-width: var(--tag-w);
  animation: tag-drop 1s cubic-bezier(0.34, 1.2, 0.64, 1) 0.15s backwards;
}

@keyframes tag-drop {
  from {
    opacity: 0;
    transform: translate3d(0, -3.5rem, 0);
  }

  45% {
    opacity: 1;
  }
}

/* An ivory card with a double gold frame, as in the tree chooser. */
.gift-tag {
  position: relative;
  padding: 2.875rem 2.25rem 2.25rem;
  border: 1px solid rgba(217, 178, 106, 0.6);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(169, 128, 63, 0.11) 0 1px, transparent 1.6px) 0 0 / 2.875rem 2.875rem,
    radial-gradient(circle at 70% 65%, rgba(169, 128, 63, 0.08) 0 1px, transparent 1.6px) 0 0 / 4.625rem 4.625rem,
    radial-gradient(ellipse 70% 30% at 50% 0%, #fffdf7 0%, rgba(255, 253, 247, 0) 70%),
    var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow:
    0 2.75rem 4.5rem -2.5rem rgba(0, 0, 0, 0.8),
    0 0 0 0.25rem rgba(10, 24, 18, 0.35),
    0 0 5.5rem rgba(241, 190, 100, 0.12);
  /* It swings from where the thread meets the header. */
  transform-origin: 50% calc(-1 * var(--tag-drop));
  animation: tag-settle 2.8s ease-out 0.3s backwards;
}

@keyframes tag-settle {
  0% {
    transform: rotate(-2deg);
  }

  22% {
    transform: rotate(1.3deg);
  }

  45% {
    transform: rotate(-0.75deg);
  }

  68% {
    transform: rotate(0.35deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* The thread, from behind the header's hem down through the tag's hole. */
.gift-tag::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--tag-drop) - 0.75rem);
  left: 50%;
  width: 1px;
  height: calc(var(--tag-drop) + 1.625rem);
  margin-left: -0.5px;
  background: linear-gradient(180deg, rgba(217, 178, 106, 0.25), var(--gold) 35%);
}

/* Inner hairline, like the border of a printed card. */
.gift-tag::after {
  content: "";
  position: absolute;
  inset: 0.4375rem;
  border: 1px solid rgba(217, 178, 106, 0.3);
  border-radius: 0.6875rem;
  pointer-events: none;
}

/* Snow lies along the top edge, thinning out towards the corners. */
.gift-tag__snow {
  position: absolute;
  left: 0.625rem;
  bottom: calc(100% - 0.125rem);
  z-index: 1;
  width: calc(100% - 1.25rem);
  height: 1.125rem;
  filter: drop-shadow(0 -0.125rem 0.375rem rgba(255, 255, 255, 0.18));
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  pointer-events: none;
}

.gift-tag__sparkle {
  transform-origin: center;
  transform-box: fill-box;
  animation: tag-sparkle 3.2s ease-in-out var(--d, 0s) infinite;
}

@keyframes tag-sparkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

.gift-tag__hole {
  position: absolute;
  top: 0.5625rem;
  left: 50%;
  z-index: 1;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: -0.375rem;
  border: 2px solid rgba(217, 178, 106, 0.85);
  border-radius: 50%;
  background: var(--evergreen);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Two fir twigs fan out from behind the bow. */
.gift-tag__sprig {
  position: absolute;
  top: -1.0625rem;
  z-index: 2;
  width: 6rem;
  height: 2.375rem;
  filter: drop-shadow(0 0.125rem 0.125rem rgba(20, 30, 20, 0.35));
  pointer-events: none;
}

.gift-tag__sprig svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift-tag__sprig--right {
  left: 50%;
  transform-origin: 0 65%;
  transform: rotate(-7deg);
}

.gift-tag__sprig--left {
  right: 50%;
  transform-origin: 100% 65%;
  transform: rotate(7deg);
}

.gift-tag__sprig--left svg {
  transform: scaleX(-1);
}

.gift-tag .sprig__stem {
  fill: none;
  stroke: #5a4326;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.gift-tag .sprig__needle {
  fill: none;
  stroke: #2f6b45;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.gift-tag .sprig__needle--light {
  stroke: #4c8a5c;
}

/* A red bow at the hole, holly with berries in the corners. */
.gift-tag__bow {
  position: absolute;
  top: -0.375rem;
  left: 50%;
  z-index: 3;
  width: 3.5rem;
  height: 2.0625rem;
  margin-left: -1.75rem;
  filter: drop-shadow(0 0.125rem 0.25rem rgba(40, 10, 10, 0.35));
  pointer-events: none;
}

.gift-tag .bow__loop,
.gift-tag .bow__tail {
  fill: #b8323f;
}

.gift-tag .bow__knot {
  fill: #8d2431;
}

.gift-tag .bow__shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.gift-tag__holly {
  position: absolute;
  top: 0.5625rem;
  width: 3rem;
  height: 3rem;
  pointer-events: none;
}

.gift-tag__holly svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gift-tag__holly--left {
  left: 0.5625rem;
}

.gift-tag__holly--right {
  right: 0.5625rem;
  transform: scaleX(-1);
}

.gift-tag .holly__leaf path:first-child {
  fill: #2f6b45;
}

.gift-tag .holly__vein {
  fill: none;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
  stroke-linecap: round;
}

.gift-tag .holly__berry {
  fill: #b8323f;
}

.gift-tag .holly__shine {
  fill: rgba(255, 255, 255, 0.7);
}

/* ---------- The words on the tag ---------- */

/* Everything on the tag rises into place, one line after another, once the
   tag has come down. Written as "from" only, so with motion switched off the
   page simply shows as it ends. */
.gift-tag__label,
.gift-tag__title,
.gift-tag__rule,
.gift-tag__lede,
.field,
.tag-form__submit {
  animation: tag-rise 0.7s var(--ease) calc(0.55s + var(--i, 0) * 0.07s) backwards;
}

@keyframes tag-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 0.875rem, 0);
  }
}

/* The button lands last, with the homepage's soft spring. */
.tag-form__submit {
  animation-name: tag-land;
  animation-timing-function: cubic-bezier(0.3, 1.45, 0.5, 1);
}

@keyframes tag-land {
  from {
    opacity: 0;
    transform: translate3d(0, 0.875rem, 0) scale(0.9);
  }
}

.gift-tag__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  color: var(--gold-deep);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* The eyebrow's little diamonds, one each side. */
.gift-tag__label::before,
.gift-tag__label::after {
  content: "";
  flex: none;
  width: 0.3125rem;
  height: 0.3125rem;
  background: currentColor;
  transform: rotate(45deg);
}

/* The letter-spacing trails the last letter; this evens the two sides. */
.gift-tag__label::after {
  margin-left: -0.2em;
}

.gift-tag__title {
  margin-top: 0.4375rem;
  color: var(--ink);
  font-size: 2.75rem;
  line-height: 1.05;
}

.gift-tag__title em {
  color: var(--berry);
}

/* The berry word catches the light once as it lands (the homepage's glint). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .gift-tag__glint {
    display: inline-block;
    padding: 0.06em 0.26em 0.34em 0.16em;
    margin: -0.06em -0.26em -0.34em -0.16em;
    background: linear-gradient(100deg, var(--berry) 0%, var(--berry) 38%, #e0a070 50%, var(--berry) 62%, var(--berry) 100%) 0% 0 / 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: em-glint 1.4s ease-in-out 1.35s 1 backwards;
  }
}

.gift-tag__rule {
  position: relative;
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 0.9375rem auto 0;
  background: linear-gradient(90deg, rgba(217, 178, 106, 0), var(--gold), rgba(217, 178, 106, 0));
}

.gift-tag__rule::after {
  content: "";
  position: absolute;
  top: -0.1875rem;
  left: 50%;
  width: 0.375rem;
  height: 0.375rem;
  margin-left: -0.1875rem;
  background: var(--gold);
  transform: rotate(45deg);
}

.gift-tag__lede {
  margin-top: 0.875rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-wrap: balance;
}
/* ---------- The form ---------- */

.tag-form {
  margin-top: 1.875rem;
}

.field + .field {
  margin-top: 1.375rem;
}

/* Each field sits in a light gold frame with its name set into the top edge,
   where the tree chooser's choices carry their ornament. The frame brightens
   under the pointer and turns solid while it is being filled in. */
.field__frame {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.5rem;
  border: 1px solid rgba(169, 128, 63, 0.45);
  border-radius: 0.75rem;
  background: #fffefa;
  box-shadow: inset 0 1px 0.1875rem rgba(138, 101, 38, 0.1);
  transition: border-color 0.25s, box-shadow 0.3s;
}

.field__frame:hover {
  border-color: rgba(169, 128, 63, 0.9);
}

.field__frame:focus-within {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 0 0 0.3125rem rgba(217, 178, 106, 0.3);
}

/* Half on the paper, half on the field: the background follows suit. */
.field__label {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  padding: 0 0.5rem 0 calc(0.5rem + 0.18em);
  background: linear-gradient(180deg, var(--paper) 0 50%, #fffefa 50% 100%);
  color: var(--gold-deep);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -52%);
  transition: color 0.25s;
}

.field__frame:focus-within .field__label {
  color: var(--ink);
}

.field__icon {
  position: absolute;
  left: 1.0625rem;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.25s;
}

.field__frame:focus-within .field__icon {
  stroke: var(--berry);
}

/* 16px, so a phone does not zoom the page when the field is tapped. */
.field__input {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 1rem 0 3.125rem;
  border: 0;
  border-radius: inherit;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

.field__input::placeholder {
  color: rgba(94, 101, 95, 0.62);
  opacity: 1;
}


/* A saved email or password keeps the field's own colours. */
.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 62.5rem #fffefa inset;
  box-shadow: 0 0 0 62.5rem #fffefa inset;
}
/* What is wrong with a field, said under it; the row opens to make room. */
.field__error {
  display: grid;
  grid-template-rows: 0fr;
  color: var(--berry);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  /* A message that needs two lines is split evenly, never one word alone. */
  text-wrap: balance;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease), opacity 0.25s;
}

.field__error > span {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.field__error > span::before {
  content: "";
  display: block;
  height: 0.5rem;
}

.field.is-invalid .field__error {
  grid-template-rows: 1fr;
  opacity: 1;
}

.field.is-invalid .field__frame,
.field.is-invalid .field__frame:hover {
  border-color: #a3293b;
  box-shadow: 0 0 0 1px #a3293b, 0 0 0 0.3125rem rgba(163, 41, 59, 0.1);
}

.field.is-invalid .field__label,
.field.is-invalid .field__frame:focus-within .field__label {
  color: var(--berry);
}

.field.is-invalid .field__icon {
  stroke: var(--berry);
}
/* ---------- The button ---------- */

.tag-form__submit {
  width: 100%;
  margin-top: 0.875rem;
  font-size: 1rem;
  cursor: pointer;
}

/* One sweep of light across the button after it lands, as in the hero. */
.tag-form__submit::after {
  animation: tag-sweep 0.9s var(--ease) 1.9s 1 backwards;
}

@keyframes tag-sweep {
  from {
    left: -60%;
  }

  to {
    left: 130%;
  }
}

/* While it is working: a turning star in place of the arrow. */
.tag-form__star {
  display: none;
  width: 1.0625rem;
  height: 1.0625rem;
  fill: #2a1a09;
}

.tag-form__submit.is-busy {
  pointer-events: none;
}

.tag-form__submit.is-busy .tag-form__star {
  display: block;
  animation: tag-spin 1.2s linear infinite;
}

.tag-form__submit.is-busy .tag-form__arrow {
  display: none;
}

@keyframes tag-spin {
  to {
    transform: rotate(360deg);
  }
}

.tag-form__note {
  margin-top: 0.875rem;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-wrap: balance;
  animation: tag-rise 0.5s var(--ease) backwards;
}

.tag-form__note[hidden] {
  display: none;
}
/* ---------- After the form has been sent ----------
   The page comes back with its answer already in place: nothing drops, rises
   or fades in a second time. Only the answer itself arrives (the note rises,
   and stage.js lets the tag shake its head if a field is wrong). */

.stage--settled .stage__hang,
.stage--settled .gift-tag,
.stage--settled .gift-tag__label,
.stage--settled .gift-tag__title,
.stage--settled .gift-tag__glint,
.stage--settled .gift-tag__rule,
.stage--settled .gift-tag__lede,
.stage--settled .field,
.stage--settled .tag-form__submit,
.stage--settled .tag-form__submit::after,
.stage--settled .stage__tree,
.stage--settled .stage__snow {
  animation: none;
}

.stage--settled .bauble {
  animation-name: none, bauble-sway;
}
/* ---------- Shorter desktop windows: the tag tightens so it still fits ---------- */

@media (min-width: 1024px) and (max-height: 720px) {
  :root {
    --tag-h: 27.75rem;
  }

  /* Shorter trees and threads, so the baubles stay clear of the treetops. */
  .stage {
    --tree-h: min(34rem, 50vh, 34vw);
  }

  .bauble--outer {
    --drop: 8rem;
  }

  .bauble--middle {
    --drop: 4.5rem;
  }

  .gift-tag {
    padding: 2.625rem 2.25rem 1.75rem;
  }

  .gift-tag__label {
    margin-top: 0.5rem;
  }

  .gift-tag__title {
    font-size: 2.375rem;
  }

  .gift-tag__rule {
    margin-top: 0.75rem;
  }

  .gift-tag__lede {
    margin-top: 0.625rem;
  }

  .tag-form {
    margin-top: 1.5rem;
  }

  .field + .field {
    margin-top: 1.125rem;
  }

  .field__frame {
    height: 3.25rem;
  }


  .tag-form__submit {
    min-height: 3.125rem;
    margin-top: 0.625rem;
  }
}
/* ---------- Tall windows (an upright monitor, a large tablet held upright) ----------
   The scene stops growing with the screen: the stage is as tall as the tag
   needs, and the garland and footer follow straight on, in view and whole. */

@media (min-width: 1024px) and (min-height: 1000px) and (max-aspect-ratio: 16/10) {
  .stage {
    --tag-drop: 9rem;
    --tree-h: min(28rem, 34vw);
    min-height: 0;
  }
}

/* =================================================================
   Tablets and phones (under 1024px): the header scrolls away with the
   page, as on the tree chooser, and the stage is only as tall as the tag
   needs, so the garland and the footer follow straight on.
   ================================================================= */

@media (max-width: 1023.98px) {
  .stage-page .site-header {
    position: relative;
  }

  .stage {
    --tag-drop: 4.5rem;
    --tree-h: min(26rem, 34vw);
    min-height: 0;
    padding: var(--tag-drop) 0 8.5rem;
  }

  .bauble {
    top: -0.5rem;
  }

  .bauble--outer {
    --f: 0.72;
    --drop: 6.5rem;
    --size: 2.375rem;
  }

  .bauble--middle {
    --f: 0.3;
    --drop: 3rem;
    --size: 1.75rem;
  }

  /* No room for a third. */
  .bauble--inner {
    display: none;
  }

  .stage__tree {
    bottom: 5rem;
  }

  .stage-page .site-footer__inner,
  .stage-page .site-footer__plain {
    padding-top: 7rem;
  }
}

/* Upright tablets: the tag fills most of the width, so the trees stand down
   and one bauble hangs each side. */
@media (max-width: 899.98px) {
  .stage__tree {
    display: none;
  }
}

@media (max-width: 759.98px) {
  .bauble--outer {
    --f: 0.5;
    --drop: 5rem;
    --size: 2rem;
  }

  .bauble--middle {
    display: none;
  }
}

/* =================================================================
   Phones (under 600px): the tag takes the screen's width; the lights, the
   snow and the garland carry the rest.
   ================================================================= */

@media (max-width: 599.98px) {
  .stage {
    --tag-drop: 3.25rem;
    padding-bottom: 6.5rem;
  }

  .stage__baubles {
    display: none;
  }

  .gift-tag {
    padding: 2.75rem 1.25rem 1.625rem;
  }

  .gift-tag__title {
    font-size: 2.375rem;
  }

  .gift-tag__holly {
    width: 2.625rem;
    height: 2.625rem;
  }

  .tag-form {
    margin-top: 1.625rem;
  }

  .tag-form__submit {
    min-height: 3.375rem;
  }

  .stage-page .site-footer__inner,
  .stage-page .site-footer__plain {
    padding-top: 96px;
  }
}

/* The narrowest phones. */
@media (max-width: 359.98px) {
  .gift-tag {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .gift-tag__title {
    font-size: 2.125rem;
  }

  .field__input {
    padding-left: 2.875rem;
  }

  .field__icon {
    left: 0.875rem;
  }
}

/* ---------- Reduced motion ----------
   The homepage stylesheet already stops every animation; without the rise
   and the drop, everything is simply in place. The snow is not added at all
   (stage.js), and the twinkles hold a steady glow. */

@media (prefers-reduced-motion: reduce) {
  .tag-form__submit.is-busy .tag-form__star {
    animation: tag-spin 2.4s linear infinite !important;
  }
}
