/* ==========================================================================
   Alkando — the finale at the foot of the home page.

   Five glyph bubbles start scattered around the heading and, as the page
   reaches its end, fly in and settle into an arc beneath it — the middle
   one largest and highest, like the rating stars at the foot of
   structured.app. finale.js drives it from the scroll position, so it runs
   exactly as fast as the reader scrolls and backwards when they go back up.
   ========================================================================== */

/* --- the light stretch ----------------------------------------------------
   The app's light identity colours (ThemeTokens.alkandoViolet). No
   background of its own: flow.js fades the page colour to lilac as this
   comes into view, so the text here is dark. */
.fin-sec {
  --lt-text: #1e1436;
  --lt-text-2: #6a6289;
  --lt-accent: #6b3fe8;
  position: relative;
  z-index: 3;
  padding: clamp(110px, 16vh, 170px) 24px clamp(130px, 18vh, 190px);
  color: var(--lt-text);
}

.fin {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--ak-font-ui);
}

.fin__title {
  margin: 0;
  font: 800 clamp(2.6rem, 7vw, 4.8rem)/1.02 var(--ak-font-rounded);
  letter-spacing: -0.03em;
}

.fin__row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  height: 120px;
  margin: 34px 0 10px;
}

/* Each bubble's resting place is its slot in the row; finale.js moves it
   there from its scattered start (--dx, --dy, --rot, --sc) with --t going
   0 → 1. `translate`/`rotate`/`scale` rather than one `transform`, so the
   bob on the inner <i> never fights it. */
.fin__b {
  --t: 1;
  flex-shrink: 0;
  width: var(--s);
  height: var(--s);
  margin-top: var(--drop);
  translate: calc(var(--dx) * (1 - var(--t))) calc(var(--dy) * (1 - var(--t)));
  rotate: calc(var(--rot) * (1 - var(--t)));
  scale: calc(var(--sc) + (1 - var(--sc)) * var(--t));
  opacity: calc(0.35 + 0.65 * var(--t));
  will-change: translate, rotate, scale;
}

.fin__b i {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--c);
  animation: floatBob 6s ease-in-out infinite alternate;
  --r: 0deg;
}

.fin__b:nth-child(2) i { animation-duration: 5.2s; }
.fin__b:nth-child(3) i { animation-duration: 6.8s; }
.fin__b:nth-child(4) i { animation-duration: 5.6s; }
.fin__b:nth-child(5) i { animation-duration: 7.2s; }

.fin__b svg {
  width: 46%;
  height: 46%;
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fin__sub {
  max-width: 560px;
  margin: 0 auto;
  color: var(--lt-text-2);
  font: 400 clamp(1.05rem, 1.8vw, 1.25rem)/1.5 var(--ak-font-ui);
}

.fin__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.fin__cta {
  display: inline-flex;
  align-items: center;
  height: 56px;
  padding: 0 30px;
  border-radius: 999px;
  /* On the light sheet the white capsule would vanish: brand violet. */
  background: var(--lt-accent);
  color: #fff;
  font: 700 17px/1 var(--ak-font-ui);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(107, 63, 232, 0.35);
  transition: transform var(--ak-dur-tap) var(--ak-ease-out);
}

.fin__cta:active {
  transform: scale(0.97);
}

.fin__beta {
  padding: 7px 12px;
  border: 1px solid rgba(107, 63, 232, 0.25);
  border-radius: 999px;
  background: rgba(107, 63, 232, 0.08);
  color: var(--lt-accent);
  font: 700 12.5px/1 var(--ak-font-ui);
}

.fin a:focus-visible {
  outline: 2px solid var(--lt-accent);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .fin__row {
    height: 90px;
    zoom: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fin__b {
    --t: 1 !important;
  }

  .fin__b i {
    animation: none;
  }
}
