/* Ion button: a glossy ultramarine pill with drifting pearl light.
   Markup is added by ion.js: <a class="ion"><span class="ion-fx"><i class="ion-l"><b class="ion-haze"></b><b class="ion-str"></b><b class="ion-tint"></b><b class="ion-core"></b></i><i class="ion-r"></i></span><span class="ion-t">Label</span></a>
   Every effect scales with --h (the button height, set by ion.js). */
.ion, .btn.primary.ion {
  --h: 48px;
  --lx: .5;
  position: relative; isolation: isolate;
  color: #ebebf9;
  background: linear-gradient(90deg, #1238c4 0%, #0a20cc 38%, #0412d2 66%, #0710e2 100%);
  box-shadow:
    0 0 0 .5px rgba(70, 90, 255, .5),
    0 calc(var(--h) * .16) calc(var(--h) * .3) calc(var(--h) * -.1) rgba(0, 0, 14, .9),
    0 calc(var(--h) * .1) calc(var(--h) * .55) calc(var(--h) * -.18) rgba(24, 44, 255, .42);
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(.23, 1, .32, 1), filter .3s cubic-bezier(.23, 1, .32, 1), box-shadow .3s cubic-bezier(.23, 1, .32, 1);
}
.ion-fx {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden; pointer-events: none;
  isolation: isolate; background: inherit; /* the grain blends with the blue only when the blue is inside this group */
  -webkit-mask-image: -webkit-radial-gradient(#fff, #000); /* Safari: clip the blurred light to the pill */
}
.ion-t { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: inherit; text-shadow: 0 0 calc(var(--h) * .22) rgba(4, 10, 90, .6), 0 1px 1px rgba(4, 10, 90, .35); }

/* the light: soft pearl bands that run diagonally like the reflection on glass.
   Four layers drift, tilt and stretch at different, unrelated speeds, so the light flows like liquid and never repeats exactly. */
.ion-l {
  position: absolute; inset: -40% -45%;
  filter: blur(calc(var(--h) * .035));
  /* like on real glass the light is brightest at the top and bottom edge, calmer behind the label */
  -webkit-mask-image: linear-gradient(180deg, #000 24%, rgba(0, 0, 0, .5) 43%, rgba(0, 0, 0, .5) 57%, #000 76%);
          mask-image: linear-gradient(180deg, #000 24%, rgba(0, 0, 0, .5) 43%, rgba(0, 0, 0, .5) 57%, #000 76%);
  /* leans toward the cursor (--lx) and with the page as it scrolls (--sc), like a reflection when the angle changes */
  translate: calc((var(--lx) - .5 + var(--sc, 0)) * 14%) 0;
  transition: translate .9s cubic-bezier(.23, 1, .32, 1);
  animation: ion-in 1.5s cubic-bezier(.16, 1, .3, 1) .15s both;
}
@keyframes ion-in { from { transform: translateX(-30%); } to { transform: translateX(0); } }
.ion-l > b { position: absolute; inset: 0; animation-timing-function: ease-in-out; animation-iteration-count: infinite; animation-direction: alternate; animation-delay: calc(var(--i, 0) * -2.3s - 1s); }
/* lavender haze around the main band, and a faint blue echo to its right */
.ion-haze {
  background:
    linear-gradient(58deg, transparent 37%, rgba(150, 105, 255, .32) 42%, rgba(200, 195, 255, .5) 46%, rgba(205, 198, 255, .45) 50%, rgba(130, 115, 235, .28) 54%, transparent 60%),
    linear-gradient(58deg, transparent 59%, rgba(40, 60, 255, .4) 62%, rgba(90, 120, 255, .2) 63.5%, transparent 67%);
  animation-name: ion-hx, ion-hr; animation-duration: 8s, 11s;
}
/* the white core: slides inside the haze a little faster and stretches and narrows */
.ion-core {
  background: linear-gradient(58deg, transparent 45.2%, rgba(235, 235, 255, .75) 46.5%, rgba(255, 255, 255, .98) 47.3%, rgba(255, 255, 255, .93) 48.6%, rgba(225, 220, 255, .6) 49.9%, transparent 51.4%);
  animation-name: ion-cx, ion-cr, ion-cs; animation-duration: 6s, 9s, 5s;
}
/* thin streaks, darker glass and a lighter corner on the left, sliding the other way */
.ion-str {
  background:
    linear-gradient(58deg,
      transparent 29%, rgba(180, 175, 255, .5) 30.4%, transparent 31.6%,
      transparent 33%, rgba(150, 200, 255, .42) 33.9%, transparent 34.8%,
      transparent 36%, rgba(200, 185, 255, .36) 37.2%, transparent 38.6%),
    linear-gradient(58deg, transparent 38%, rgba(16, 16, 64, .4) 40.5%, transparent 43.5%),
    radial-gradient(22% 30% at 34% 38%, rgba(120, 140, 240, .4), transparent 72%);
  animation-name: ion-sx, ion-sr; animation-duration: 10s, 13s;
}
/* a pool of violet and cyan that wanders slowly through the glass */
.ion-tint {
  background:
    radial-gradient(16% 30% at 44% 46%, rgba(150, 95, 255, .34), transparent 70%),
    radial-gradient(12% 22% at 56% 60%, rgba(90, 200, 255, .22), transparent 70%);
  animation-name: ion-tx, ion-ty; animation-duration: 9s, 6.5s;
}
@keyframes ion-hx { from { transform: translateX(-6%); } to { transform: translateX(7%); } }
@keyframes ion-hr { from { rotate: -3deg; } to { rotate: 4deg; } }
@keyframes ion-cx { from { transform: translateX(9%); } to { transform: translateX(-7%); } }
@keyframes ion-cr { from { rotate: 5deg; } to { rotate: -4deg; } }
@keyframes ion-cs { from { scale: .85 1; } to { scale: 1.25 1; } }
@keyframes ion-sx { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes ion-sr { from { rotate: 2deg; } to { rotate: -3deg; } }
@keyframes ion-tx { from { translate: -14% 0; } to { translate: 14% 0; } }
@keyframes ion-ty { from { transform: translateY(-10%); } to { transform: translateY(12%); } }

/* the WebGL light (ion.js) replaces the CSS layers when it runs */
.ion-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ion-gl .ion-l { display: none; }

/* rim light: a bright glass lip along the bottom, cyan on the left curve, fading out to the right */
.ion-r {
  position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  box-shadow:
    inset 0 calc(var(--h) * -.03) calc(var(--h) * .012) rgba(255, 255, 255, .96),
    inset calc(var(--h) * .05) calc(var(--h) * -.06) calc(var(--h) * .09) calc(var(--h) * -.03) rgba(130, 225, 255, .85),
    inset calc(var(--h) * .025) calc(var(--h) * -.02) calc(var(--h) * .03) calc(var(--h) * -.01) rgba(225, 245, 255, .7),
    inset 0 calc(var(--h) * -.1) calc(var(--h) * .14) calc(var(--h) * -.06) rgba(210, 215, 255, .4);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 52%, rgba(0, 0, 0, .3) 80%, rgba(0, 0, 0, .1) 100%);
          mask-image: linear-gradient(90deg, #000 0%, #000 52%, rgba(0, 0, 0, .3) 80%, rgba(0, 0, 0, .1) 100%);
  transition: opacity .3s;
}
/* electric blue edge on the right and a hairline on top */
.ion-fx::before {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  box-shadow:
    inset calc(var(--h) * -.03) 0 calc(var(--h) * .05) rgba(28, 40, 255, .95),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}
/* fine film grain */
.ion-fx::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 140px; mix-blend-mode: overlay; opacity: .42;
}

@media (hover: hover) and (pointer: fine) {
  .ion:hover, .btn.primary.ion:hover {
    filter: brightness(1.08) saturate(1.04);
    box-shadow:
      0 0 0 .5px rgba(90, 110, 255, .6),
      0 calc(var(--h) * .18) calc(var(--h) * .32) calc(var(--h) * -.1) rgba(0, 0, 14, .9),
      0 calc(var(--h) * .12) calc(var(--h) * .7) calc(var(--h) * -.16) rgba(30, 52, 255, .55);
  }
}
.ion:active, .btn.primary.ion:active { transform: scale(.98); filter: brightness(.96); transition-duration: .08s; }
.ion:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .ion-l, .ion-l > b { animation: none; transition: none; translate: none; }
}

/* on the landing page */
.btn.primary.ion { font-weight: 520; }
