/* Scroll-driven bouquet. Cards meet at the center and become the Viivaa
   icon, which then settles onto the phone. Motion is transform/opacity
   only. prefers-reduced-motion shows the icon and caption, still. */

.aio {
  position: relative;
  z-index: 0;
  height: 350vh;
  background:
    radial-gradient(980px 520px at 50% 8%, rgba(236, 72, 153, .13), transparent 62%),
    radial-gradient(720px 480px at 8% 72%, rgba(91, 110, 245, .12), transparent 64%),
    radial-gradient(680px 460px at 94% 64%, rgba(168, 85, 247, .14), transparent 62%),
    linear-gradient(180deg, #faf8fd 0%, #f6f0fb 38%, #fbf8ff 100%);
  color: #16161f;
}

.aio-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.aio-head {
  position: relative;
  z-index: 40;
  text-align: center;
  padding: 22px 22px 6px;
  flex-shrink: 0;
}

.aio-head img.aio-logo {
  display: block;
  height: 30px !important;
  width: auto !important;
  max-width: 132px !important;
  margin: 0 auto 8px;
  object-fit: contain !important;
}

.aio-kicker {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .28em;
  color: #8b7cf7;
}

.aio-title {
  font-family: Poppins, sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: .94;
  letter-spacing: -1.8px;
  color: #16161f;
  margin-top: 8px;
}

.aio-grad {
  background: linear-gradient(90deg, #5b6ef5 0%, #a855f7 42%, #ec4899 78%, #f5922f 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aio-sub {
  max-width: 540px;
  margin: 12px auto 0;
  padding: 0 8px;
  font-family: Manrope, sans-serif;
  font-size: clamp(14px, 1.55vw, 17px);
  line-height: 1.45;
  color: #5c5c6b;
}

.aio-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  container-type: size;
}

.aio-funnel {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(480px, 70%);
  height: 42%;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) scale(.8);
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 214, 90, .55) 0%, rgba(255, 90, 140, .28) 28%, rgba(90, 120, 255, .1) 52%, transparent 70%);
  will-change: transform, opacity;
}

.aio-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: 188px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 7px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(255, 255, 255, .9));
  border: 1px solid rgba(255, 255, 255, .98);
  box-shadow:
    0 18px 36px rgba(70, 40, 120, .13),
    0 2px 6px rgba(70, 40, 120, .05);
  transform: translate3d(-50%, -50%, 0) rotate(var(--r));
  transform-origin: center center;
  pointer-events: none;
  will-change: transform, opacity;
}

.aio-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), transparent 36%);
  pointer-events: none;
}

.aio-art,
.aio-copy {
  position: relative;
  z-index: 1;
}

.aio-art {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  overflow: hidden;
}

.aio-art svg,
.aio-art img {
  width: 36px;
  height: 36px;
  display: block;
}

.aio-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aio-icon-wrap img.aio-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aio-copy {
  min-width: 0;
}

.aio-copy h3 {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
  letter-spacing: -.2px;
  color: #1c1c28;
}

.aio-copy p {
  font-family: Manrope, sans-serif;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  color: #7b7b8e;
  margin-top: 2px;
}

.aio-card[data-card="nutrition"]  { --x: 20%; --y: 10%; --r: -7deg; --z: 6;  --bg: #fff1e4; }
.aio-card[data-card="scanner"]    { --x: 48%; --y: 6%;  --r: 3deg;  --z: 8;  --bg: #ffe8f1; }
.aio-card[data-card="recipes"]    { --x: 76%; --y: 12%; --r: 6deg;  --z: 6;  --bg: #fff6dc; }
.aio-card[data-card="steps"]      { --x: 15%; --y: 28%; --r: -6deg; --z: 5;  --bg: #e8f0ff; }
.aio-card[data-card="sleep"]      { --x: 34%; --y: 22%; --r: -2deg; --z: 7;  --bg: #eee8ff; }
.aio-card[data-card="glp1"]       { --x: 64%; --y: 20%; --r: 4deg;  --z: 7;  --bg: #e7fbf4; }
.aio-card[data-card="habits"]     { --x: 84%; --y: 30%; --r: 6deg;  --z: 5;  --bg: #e9fff4; }
.aio-card[data-card="progress"]   { --x: 16%; --y: 46%; --r: -5deg; --z: 8;  --bg: #f4e9ff; }
.aio-card[data-card="gut"]        { --x: 32%; --y: 38%; --r: 2deg;  --z: 9;  --bg: #e7f8ea; }
.aio-card[data-card="mens"]       { --x: 68%; --y: 36%; --r: -3deg; --z: 9;  --bg: #e8eeff; }
.aio-card[data-card="hydration"]  { --x: 86%; --y: 48%; --r: 5deg;  --z: 8;  --bg: #e5f5ff; }
.aio-card[data-card="cycle"]      { --x: 15%; --y: 62%; --r: -7deg; --z: 6;  --bg: #ffe6f3; }
.aio-card[data-card="planning"]   { --x: 28%; --y: 58%; --r: 3deg;  --z: 7;  --bg: #fff0e6; }
.aio-card[data-card="mental"]     { --x: 74%; --y: 56%; --r: -4deg; --z: 8;  --bg: #f3e9ff; }
.aio-card[data-card="courses"]    { --x: 84%; --y: 64%; --r: 5deg;  --z: 5;  --bg: #eee9ff; }
.aio-card[data-card="community"]  { --x: 18%; --y: 76%; --r: -3deg; --z: 4;  --bg: #ffe8f0; }
.aio-card[data-card="game"]       { --x: 82%; --y: 76%; --r: 4deg;  --z: 4;  --bg: #fff6d8; }
.aio-card[data-card="ai"]         { --x: 50%; --y: 32%; --r: 0deg;  --z: 10; --bg: #efeaff; width: 210px; }

.aio-phone {
  position: absolute;
  left: 50%;
  top: 84px;
  z-index: 20;
  width: min(240px, calc((100cqh - 128px) * 9 / 19.15));
  transform: translate3d(-50%, 0, 0);
  transform-origin: center bottom;
  pointer-events: none;
}

.aio-device {
  position: relative;
  background: #121218;
  border-radius: 32px;
  padding: 8px;
  aspect-ratio: 9 / 19.15;
  box-shadow:
    0 26px 44px rgba(50, 30, 90, .28),
    inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.aio-device::before,
.aio-device::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: #2c2c34;
}

.aio-device::before { left: -2px; top: 22%; height: 28px; box-shadow: 0 36px 0 #2c2c34; }
.aio-device::after { right: -2px; top: 28%; height: 52px; }

.aio-screen {
  position: relative;
  height: 100%;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 206, 120, .45), transparent 42%),
    linear-gradient(180deg, #fff8fb 0%, #f4f0ff 58%, #eef3ff 100%);
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  font-family: Poppins, sans-serif;
  color: #1c1c28;
  font-size: clamp(7px, 6.6cqi, 13px);
}

.aio-screen-glow {
  position: absolute;
  inset: -10% 0 auto;
  height: 55%;
  z-index: 4;
  pointer-events: none;
  opacity: .12;
  background: radial-gradient(circle at 50% 0%, rgba(186, 140, 255, .85), rgba(236, 72, 153, .2) 42%, transparent 70%);
}

.aio-sink,
.aio-land {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 1px;
  height: 1px;
}

.aio-screen > :not(.aio-land) {
  visibility: hidden;
}

.aio-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55em .9em .15em;
  font-size: .72em;
  font-weight: 600;
  color: #1c1c28;
}

.aio-island {
  width: 22%;
  height: .72em;
  border-radius: 999px;
  background: #121218;
}

.aio-status-icons { display: flex; gap: .28em; align-items: center; }
.aio-status-icons i {
  display: block;
  width: .62em;
  height: .42em;
  border-radius: 1px;
  background: #1c1c28;
}
.aio-status-icons i:nth-child(2) { width: .42em; height: .42em; border-radius: 50%; }
.aio-status-icons i:nth-child(3) { width: .9em; border-radius: 2px; border: 1px solid #1c1c28; background: linear-gradient(90deg, #1c1c28 70%, transparent 70%); }

.aio-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35em .85em .2em;
}

.aio-brand {
  font-weight: 800;
  font-size: 1.05em;
  letter-spacing: -.4px;
  background: linear-gradient(90deg, #5b6ef5, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aio-appbar-tools { display: flex; align-items: center; gap: .4em; }
.aio-appbar-tools svg { width: 1.15em; height: 1.15em; display: block; }
.aio-avatar {
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7c6e2, #c4b5fd);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.aio-scorehead {
  text-align: center;
  font-size: .68em;
  font-weight: 600;
  color: #8a8aa0;
  margin-top: .35em;
}

.aio-score-row {
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .55em .8em .2em;
}

.aio-ring {
  width: 42%;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(from -90deg, #7c5cff 0 58%, #ec4899 58% 78%, #f3e8ff 78% 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(124, 92, 255, .18);
}

.aio-ring > div {
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.aio-ring b {
  font-weight: 800;
  font-size: 1.55em;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #7c5cff, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aio-ring small {
  font-size: .58em;
  font-weight: 600;
  color: #9a9ab0;
  margin-top: .12em;
}

.aio-score-copy { min-width: 0; flex: 1; }
.aio-score-copy strong {
  display: block;
  font-size: .92em;
  font-weight: 800;
  letter-spacing: -.3px;
}
.aio-score-copy p {
  margin-top: .25em;
  font-family: Manrope, sans-serif;
  font-size: .62em;
  line-height: 1.3;
  font-weight: 600;
  color: #6e6e82;
}
.aio-score-copy em {
  display: block;
  margin-top: .35em;
  font-style: normal;
  font-size: .58em;
  font-weight: 700;
  color: #33a36a;
}

.aio-spark {
  margin: .15em .9em 0;
  height: 2.4em;
}
.aio-spark svg { width: 100%; height: 100%; display: block; }

.aio-insight {
  margin: .15em .9em 0;
  font-size: .62em;
  font-weight: 700;
  color: #7c5cff;
}

.aio-tabbar {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: .1em;
  padding: .45em .25em .7em;
  border-top: 1px solid #f0eaf8;
  background: rgba(255, 255, 255, .92);
  font-size: .52em;
  font-weight: 600;
  color: #9a9ab0;
  text-align: center;
  line-height: 1.15;
}

.aio-tabbar span { display: flex; flex-direction: column; align-items: center; gap: .2em; }
.aio-tabbar svg { width: 1.5em; height: 1.5em; }
.aio-tabbar .is-on { color: #7c5cff; font-weight: 700; }
.aio-v {
  width: 2.4em;
  height: 2.4em;
  margin-top: -.9em;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5922f, #ec4899 45%, #8b5cf6 75%, #5b83ef);
  color: #fff !important;
  font-weight: 800;
  font-size: 1.15em !important;
  display: grid !important;
  place-items: center;
  box-shadow: 0 6px 12px rgba(124, 92, 255, .35);
}

.aio-finale {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.aio-aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(280px, 54vw);
  height: min(280px, 54vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 80, .7) 0%, rgba(255, 90, 150, .32) 34%, rgba(90, 130, 255, .14) 58%, transparent 72%);
  transform: translate3d(-50%, -50%, 0) scale(.35);
  opacity: 0;
  will-change: transform, opacity;
}

.aio-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: 0;
  border-radius: 50%;
  background: var(--c, #fff);
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(.2);
  will-change: transform, opacity;
}

.aio-burst span:nth-child(odd) { width: 7px; height: 7px; border-radius: 2px; }
.aio-burst span:nth-child(3n) { width: 12px; height: 12px; }

.aio-icon-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(112px, 18vh, 156px);
  aspect-ratio: 1;
  transform: translate3d(-50%, -50%, 0);
  opacity: 0;
  z-index: 2;
  will-change: transform, opacity;
}

.aio-icon {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.aio-eye {
  transform-box: fill-box;
  transform-origin: center;
}

.aio-finale-cap {
  position: absolute;
  left: 50%;
  top: calc(50% - clamp(104px, 14vh, 136px));
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 28px);
  letter-spacing: -.4px;
  color: #1c1c28;
  opacity: 0;
  z-index: 3;
}

.aio-mark-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Sits just under the phone once the finale lands, above the section background. */
#features {
  position: relative;
  z-index: 1;
}

@media (max-width: 1100px) {
  .aio-card { width: 172px; }
  .aio-card[data-card="ai"] { width: 196px; }
  .aio-copy h3 { font-size: 12.5px; }
}

@media (max-width: 760px) {
  .aio {
    height: 320vh;
  }
  .aio-icon-wrap { width: clamp(104px, 30vw, 128px); }
  .aio-finale-cap { font-size: 18px; }
  .aio-aura { width: 200px; height: 200px; }
  .aio-head { padding: 14px 16px 2px; }
  .aio-head img.aio-logo { height: 26px !important; margin-bottom: 4px; }
  .aio-kicker { font-size: 11px; letter-spacing: .22em; }
  .aio-title { letter-spacing: -1.2px; margin-top: 4px; }
  .aio-sub { margin-top: 8px; font-size: 13.5px; }
  .aio-card {
    width: 27%;
    gap: 4px;
    padding: 4px 6px 4px 4px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(70, 40, 120, .1);
  }
  .aio-card[data-card="ai"] { width: 27%; }
  .aio-art { width: 22px; height: 22px; border-radius: 7px; }
  .aio-art svg,
  .aio-art img { width: 22px; height: 22px; }
  .aio-copy h3 { font-size: 9.5px; line-height: 1.15; }
  .aio-copy p { font-size: 8px; line-height: 1.15; }
  .aio-phone { top: 62px; width: min(78vw, calc((100cqh - 106px) * 9 / 19.15)); }
  .aio-device { border-radius: 26px; padding: 6px; }
  .aio-screen { border-radius: 20px; }

  .aio-card[data-card="nutrition"]  { --x: 18%; --y: 9%;  --r: -2deg; }
  .aio-card[data-card="scanner"]    { --x: 50%; --y: 8%;  --r: 2deg; }
  .aio-card[data-card="recipes"]    { --x: 82%; --y: 10%; --r: 2deg; }
  .aio-card[data-card="steps"]      { --x: 18%; --y: 25%; --r: 2deg; }
  .aio-card[data-card="sleep"]      { --x: 50%; --y: 24%; --r: -2deg; }
  .aio-card[data-card="habits"]     { --x: 82%; --y: 26%; --r: 2deg; }
  .aio-card[data-card="progress"]   { --x: 18%; --y: 41%; --r: -2deg; }
  .aio-card[data-card="gut"]        { --x: 50%; --y: 40%; --r: 2deg; }
  .aio-card[data-card="hydration"]  { --x: 82%; --y: 42%; --r: -2deg; }
  .aio-card[data-card="cycle"]      { --x: 18%; --y: 57%; --r: 2deg; }
  .aio-card[data-card="mens"]       { --x: 50%; --y: 56%; --r: -2deg; }
  .aio-card[data-card="mental"]     { --x: 82%; --y: 58%; --r: 2deg; }
  .aio-card[data-card="glp1"]       { --x: 18%; --y: 73%; --r: -2deg; }
  .aio-card[data-card="planning"]   { --x: 50%; --y: 72%; --r: 2deg; }
  .aio-card[data-card="courses"]    { --x: 82%; --y: 74%; --r: -2deg; }
  .aio-card[data-card="community"]  { --x: 18%; --y: 89%; --r: 2deg; }
  .aio-card[data-card="game"]       { --x: 50%; --y: 88%; --r: -2deg; }
  .aio-card[data-card="ai"]         { --x: 82%; --y: 89%; --r: 1deg; }
}

@media (max-width: 380px) {
  .aio-title { font-size: 34px; letter-spacing: -1px; }
  .aio-sub { font-size: 12.5px; }
  .aio-copy h3 { font-size: 9px; }
  .aio-copy p { font-size: 7.5px; }
}

@media (max-height: 640px) {
  .aio-head { padding-top: 8px; }
  .aio-head img.aio-logo { height: 22px !important; margin-bottom: 2px; }
  .aio-kicker { font-size: 10px; }
  .aio-title { font-size: 32px; margin-top: 2px; }
  .aio-sub { margin-top: 4px; font-size: 12px; }
  .aio-phone { width: min(220px, 70vw, calc((100cqh - 128px) * 9 / 19.15)); }
}

@media (prefers-reduced-motion: reduce) {
  .aio { height: auto; }
  .aio-sticky {
    position: relative;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .aio-stage { min-height: 280px; }
  .aio-card,
  .aio-funnel,
  .aio-burst,
  .aio-phone { display: none !important; }
  .aio-icon-wrap,
  .aio-finale-cap { opacity: 1; }
  .aio-icon-wrap { top: 40%; transform: translate3d(-50%, -50%, 0); }
  .aio-finale-cap { top: calc(40% - 108px); }
  .aio-card,
  .aio-funnel,
  .aio-phone,
  .aio-icon-wrap,
  .aio-aura { will-change: auto; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .aio-stage { min-height: 220px; }
  .aio-finale-cap { top: calc(40% - 88px); }
}
