@property --gather-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@property --gather-turn {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}

.gather {
  --gather-shift-x: 0;
  --gather-shift-y: 0;
  --gather-spread: 1;
  position: relative;
  height: var(--gather-height);
  margin: -8px 0 24px;
  perspective: var(--gather-perspective);
  pointer-events: none;
}

.gather::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--gather-wash-size);
  height: var(--gather-wash-size);
  margin: calc(var(--gather-wash-size) / -2) 0 0 calc(var(--gather-wash-size) / -2);
  border-radius: 50%;
  background: var(--prism-wheel);
  filter: blur(46px);
  opacity: var(--gather-wash-strength);
  transition: opacity 600ms var(--ease-out), scale 900ms var(--ease-out);
}

.gather-scene {
  position: absolute;
  inset: 0;
  transform: rotateX(calc(var(--gather-shift-y) * -7deg)) rotateY(calc(var(--gather-shift-x) * 10deg));
  transform-style: preserve-3d;
  transition: transform 800ms var(--ease-out);
}

.gather-plate {
  --gather-plate-size: 172px;
  --gather-plate-depth: -70px;
  --gather-plate-turn: -7deg;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: var(--gather-plate-size);
  height: var(--gather-plate-size);
  margin: calc(var(--gather-plate-size) / -2) 0 0 calc(var(--gather-plate-size) / -2);
  border-radius: 30%;
  background: var(--gather-plate-surface);
  box-shadow: var(--gather-plate-shadow);
  translate: 0 0 var(--gather-plate-depth);
  rotate: var(--gather-plate-turn);
  transition: scale 700ms var(--ease-out), opacity 520ms var(--ease-out), rotate 900ms var(--ease-out);
}

.gather-plate::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from 210deg, var(--prism-teal), rgba(255, 255, 255, 0.9), var(--prism-pink), rgba(255, 255, 255, 0.2), var(--prism-amber), rgba(255, 255, 255, 0.9), var(--prism-teal));
  opacity: var(--gather-plate-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.gather-plate + .gather-plate {
  --gather-plate-size: 256px;
  --gather-plate-depth: -150px;
  --gather-plate-turn: 6deg;
  opacity: 0.62;
}

.gather-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: var(--gather-core-size);
  height: var(--gather-core-size);
  margin: calc(var(--gather-core-size) / -2) 0 0 calc(var(--gather-core-size) / -2);
  border-radius: var(--gather-core-radius);
  background-color: var(--ink);
  background-image: radial-gradient(circle at calc(34% + var(--gather-shift-x) * 34%) calc(22% + var(--gather-shift-y) * 26%), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 58%), var(--cta-ink-gradient);
  box-shadow: var(--gather-core-light), var(--gather-core-shadow);
  color: #FFFFFF;
  transition: scale 520ms var(--ease-out), box-shadow 600ms var(--ease-out);
}

.gather-core::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: var(--gather-rim-width);
  border-radius: inherit;
  background: conic-gradient(from var(--gather-angle), var(--prism-teal), var(--prism-blue), var(--prism-lilac), var(--prism-pink), var(--prism-coral), var(--prism-amber), var(--prism-teal));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity 520ms var(--ease-out), filter 520ms var(--ease-out);
}

.gather-core::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -70%;
  width: 46%;
  height: 140%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  opacity: 0;
  rotate: 18deg;
}

.gather-core .icon {
  grid-area: 1 / 1;
  width: 44px;
  height: 44px;
  transition: opacity 320ms var(--ease-out), scale 520ms var(--ease-out);
}

.gather-core .icon + .icon {
  width: 34px;
  height: 34px;
  opacity: 0;
  scale: 0.6;
}

.gather-orbit {
  --gather-r: 150px;
  --gather-tilt-x: -16deg;
  --gather-tilt-z: 0deg;
  --gather-start: 0deg;
  --gather-period: 36s;
  --gather-scale: 1;
  --gather-order: 0;
  --gather-turn: var(--gather-start);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  transform: rotateZ(var(--gather-tilt-z)) rotateX(var(--gather-tilt-x)) rotateY(var(--gather-turn));
  transform-style: preserve-3d;
  transition: scale 760ms var(--ease-swap), opacity 520ms var(--ease-out);
  transition-delay: calc(var(--gather-order) * 55ms);
}

.gather-item {
  --gather-cast: rgba(50, 116, 213, 0.5);
  position: absolute;
  top: -17px;
  left: -17px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--mesh-icon-sky);
  box-shadow: var(--section-heading-shadow), 0 12px 18px -7px var(--gather-cast);
  color: #FFFFFF;
  opacity: calc(0.8 - 0.2 * sin(var(--gather-turn)));
  transform: translateX(calc(var(--gather-r) * var(--gather-spread))) rotateY(calc(var(--gather-turn) * -1)) rotateX(calc(var(--gather-tilt-x) * -1)) rotateZ(calc(var(--gather-tilt-z) * -1)) scale(var(--gather-scale));
  transition: opacity 420ms var(--ease-out), filter 520ms var(--ease-out);
}

.gather-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0) 54%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), inset 0 -1px 0 rgba(22, 26, 44, 0.1);
}

.gather-item[data-tone="lilac"] {
  --gather-cast: rgba(121, 89, 214, 0.52);
  background: var(--mesh-icon-lilac);
}

.gather-item[data-tone="coral"] {
  --gather-cast: rgba(231, 121, 157, 0.55);
  background: var(--mesh-icon-coral);
}

.gather-item .icon {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
}

.gather-orbit:nth-child(1) { --gather-r: 178px; --gather-tilt-x: -24deg; --gather-tilt-z: -6deg; --gather-start: 195deg; --gather-period: 38s; --gather-scale: 1.3; --gather-order: 0; }

.gather-orbit:nth-child(2) { --gather-r: 128px; --gather-tilt-x: 32deg; --gather-tilt-z: 10deg; --gather-start: 230deg; --gather-period: 30s; --gather-scale: 1; --gather-order: 2; }

.gather-orbit:nth-child(3) { --gather-r: 150px; --gather-tilt-x: -28deg; --gather-tilt-z: 14deg; --gather-start: 60deg; --gather-period: 44s; --gather-scale: 0.9; --gather-order: 4; }

.gather-orbit:nth-child(4) { --gather-r: 112px; --gather-tilt-x: 36deg; --gather-tilt-z: -12deg; --gather-start: 150deg; --gather-period: 34s; --gather-scale: 0.95; --gather-order: 3; }

.gather-orbit:nth-child(5) { --gather-r: 170px; --gather-tilt-x: 25deg; --gather-tilt-z: 5deg; --gather-start: 345deg; --gather-period: 41s; --gather-scale: 1.25; --gather-order: 1; }

.gather-orbit:nth-child(6) { --gather-r: 140px; --gather-tilt-x: -30deg; --gather-tilt-z: -16deg; --gather-start: 310deg; --gather-period: 36s; --gather-scale: 1; --gather-order: 5; }

.gather[data-state="locked"] .gather-item {
  opacity: 0.46;
  filter: saturate(0.2) blur(1.8px);
}

.gather[data-state="locked"]::before { opacity: calc(var(--gather-wash-strength) * 0.4); }

.gather[data-state="locked"] .gather-plate { opacity: 0.42; }

.gather[data-state="locked"] .gather-core { box-shadow: var(--gather-core-shadow); }

.gather[data-state="locked"] .gather-core::before {
  opacity: 0.55;
  filter: saturate(0);
}

.gather[data-state="locked"] .gather-core .icon,
.gather[data-state="opening"] .gather-core .icon {
  opacity: 0;
  scale: 0.6;
}

.gather[data-state="locked"] .gather-core .icon + .icon,
.gather[data-state="opening"] .gather-core .icon + .icon {
  opacity: 1;
  scale: 1;
}

.gather[data-state="opening"]::before,
.gather[data-state="arriving"]::before {
  opacity: calc(var(--gather-wash-strength) * 1.6);
  scale: 1.12;
}

.gather[data-state="arriving"] .gather-orbit {
  opacity: 0;
  scale: 0.04;
}

.gather[data-state="arriving"] .gather-plate {
  scale: 0.78;
  rotate: 0deg;
}

.gather ~ .account-header {
  text-align: center;
}

.gather ~ .account-header > .account-title {
  font-size: clamp(38px, 9vw, 50px);
  text-wrap: balance;
}

.gather ~ .account-header > .account-lede {
  margin-right: auto;
  margin-left: auto;
  text-wrap: pretty;
}

@media (max-width: 479px) {
  .gather {
    --gather-spread: 0.68;
    --gather-height: 208px;
  }

  .gather-plate + .gather-plate { --gather-plate-size: 226px; }
}

@media (max-width: 359px) {
  .gather { --gather-spread: 0.62; }
}

@media (prefers-reduced-motion: no-preference) {
  .gather::before { animation: gather-wash 24s linear infinite; }

  .gather-scene { animation: gather-sway 11s ease-in-out infinite alternate; }

  .gather-plate { animation: gather-plate 900ms var(--ease-spring, var(--ease-expo)) backwards; }

  .gather-plate + .gather-plate { animation-delay: 110ms; }

  .gather-core { animation: gather-core 760ms var(--ease-bounce, var(--ease-expo)) 80ms backwards; }

  .gather-core::before { animation: gather-spin 7s linear infinite; }

  .gather-core::after { animation: gather-sheen 6.5s var(--ease-swap) 900ms infinite; }

  .gather-orbit { animation: gather-burst 1200ms var(--ease-spring, var(--ease-expo)) calc(var(--gather-order) * 80ms + 160ms) backwards, gather-orbit var(--gather-period) linear infinite; }

  .gather[data-state="locked"] .gather-orbit { animation-play-state: running, paused; }

  .gather[data-state="opening"] .gather-core,
  .gather[data-state="arriving"] .gather-core { animation: gather-pulse 1.5s ease-in-out infinite; }

  .gather[data-state="opening"] .gather-core::before,
  .gather[data-state="arriving"] .gather-core::before { animation-duration: 1.6s; }

  .gather[data-state="locked"] .gather-core::before,
  .gather[data-state="locked"] .gather-core::after { animation: none; }

  .gather[data-state="opening"]::before,
  .gather[data-state="arriving"]::before { animation-duration: 5s; }

  .gather ~ .account-header > .account-title:not(.account-greeting) {
    background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 38%, var(--prism-teal) 45%, var(--prism-pink) 51%, var(--prism-amber) 57%, var(--ink) 64%, var(--ink) 100%) 100% 0 / 320% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: account-word var(--header-entry) 80ms var(--ease-expo) both, gather-title 2200ms var(--ease-swap) 500ms both;
  }

  .gather ~ .account-stack > form,
  .gather ~ .account-empty > * { animation: gather-rise 620ms var(--ease-expo) both; }

  .gather ~ .account-stack > form:nth-of-type(1),
  .gather ~ .account-empty > :nth-child(1) { animation-delay: 300ms; }

  .gather ~ .account-stack > form:nth-of-type(2),
  .gather ~ .account-empty > :nth-child(2) { animation-delay: 360ms; }

  .gather ~ .account-stack > form:nth-of-type(3),
  .gather ~ .account-empty > :nth-child(3) { animation-delay: 420ms; }

  .gather ~ .account-stack > form:nth-of-type(4) { animation-delay: 480ms; }

  .gather ~ .account-stack > form:nth-of-type(5) { animation-delay: 540ms; }

  [data-boot="wait"] .gather *,
  [data-boot="wait"] .gather ~ .account-header > .account-title,
  [data-boot="wait"] .gather ~ .account-stack > form { animation-play-state: paused; }
}

@keyframes gather-wash {
  to { rotate: 360deg; }
}

@keyframes gather-sway {
  from { rotate: 0.35 1 0 -5deg; }
  to { rotate: 0.35 1 0 5deg; }
}

@keyframes gather-spin {
  to { --gather-angle: 360deg; }
}

@keyframes gather-sheen {
  0% {
    left: -70%;
    opacity: 0;
  }

  6% { opacity: 1; }

  24% {
    left: 130%;
    opacity: 0;
  }

  100% {
    left: 130%;
    opacity: 0;
  }
}

@keyframes gather-plate {
  from {
    opacity: 0;
    scale: 0.5;
    rotate: 0deg;
  }
}

@keyframes gather-core {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

@keyframes gather-burst {
  from {
    opacity: 0;
    scale: 0.02;
  }
}

@keyframes gather-orbit {
  from { --gather-turn: var(--gather-start); }
  to { --gather-turn: calc(var(--gather-start) + 360deg); }
}

@keyframes gather-pulse {
  0%, 100% { scale: 1; }
  50% { scale: 1.06; }
}

@keyframes gather-title {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

@keyframes gather-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (forced-colors: active) {
  .gather::before,
  .gather-plate,
  .gather-core::before,
  .gather-core::after,
  .gather-item::after { display: none; }

  .gather-core,
  .gather-item { border: 1px solid CanvasText; }
}
