/* Live About scenes: the hero constellation, the Verve / Stac / Noticed tiles and the
   Understand / Build / Improve process art, rebuilt in HTML/CSS so they move and respond.
   about-live.js adds .is-live while a scene is on screen and feeds pointer position to the hero. */

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

.lv {
  --lv-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lv-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animations wait until the scene is on screen. */
.lv *,
.lv *::before,
.lv *::after {
  animation-play-state: paused;
}

.lv.is-live *,
.lv.is-live *::before,
.lv.is-live *::after {
  animation-play-state: running;
}

/* =========================================================
   1. Hero constellation
   ========================================================= */
.lv-hero,
.ed-media.lv-hero {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(45% 55% at 82% 12%, rgba(85, 119, 184, 0.22), transparent 70%),
    radial-gradient(40% 50% at 12% 92%, rgba(201, 132, 66, 0.18), transparent 70%),
    radial-gradient(60% 60% at 50% 50%, rgba(131, 152, 198, 0.08), transparent 70%),
    #14213d;
  --mx: 0;
  --my: 0;
  cursor: default;
}

.lv-hero__stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.25;
  animation: lv-twinkle 3.2s ease-in-out infinite;
}

@keyframes lv-twinkle {
  50% { opacity: 0.9; transform: scale(1.4); }
}

.lv-hero__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lv-hero__lines line {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  animation: lv-flow 1.6s linear infinite;
  transition: stroke 0.3s;
}

.lv-hero__lines line.is-hot {
  stroke: rgba(255, 255, 255, 0.85);
}

@keyframes lv-flow {
  to { stroke-dashoffset: -18; }
}

/* Centre tile with a turning gradient ring and the real logo */
.lv-hero__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20%;
  aspect-ratio: 1;
  translate: calc(-50% + var(--mx) * -6px) calc(-50% + var(--my) * -6px);
  transition: translate 0.6s var(--lv-ease);
}

.lv-hero__core::before {
  content: "";
  position: absolute;
  inset: -18%;
  background: conic-gradient(from var(--lv-angle), #c98442, #c98442, #8398c6, #5577b8, #c98442);
  border-radius: 34%;
  filter: blur(28px);
  opacity: 0.45;
  animation: lv-spin 6s linear infinite;
}

.lv-hero__ring {
  position: absolute;
  inset: 0;
  padding: 3%;
  background: conic-gradient(from var(--lv-angle), #c98442, #c98442, #8398c6, #5577b8, #c98442);
  border-radius: 24%;
  animation: lv-spin 6s linear infinite;
}

.lv-hero__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #5d5d62 0%, #2b2b30 40%, #1a1a1e 41%, #151518 100%);
  border-radius: 22%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.lv-hero__face img {
  width: 54%;
  height: auto;
  filter: invert(1) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
  transition: transform 0.6s var(--lv-spring);
}

.lv-hero__core:hover .lv-hero__face img {
  transform: scale(1.08) rotate(-4deg);
}

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

/* Orbiting app icons */
.lv-hero__app {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 8.4%);
  aspect-ratio: 1;
  translate: calc(-50% + var(--mx) * var(--depth) * 1px) calc(-50% + var(--my) * var(--depth) * 1px);
  transition: translate 0.6s var(--lv-ease);
  z-index: 2;
  margin: 0;
  padding: 0;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.lv-hero__icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  border-radius: 24%;
  box-shadow: 0 10px 40px -6px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: lv-bob 4.4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.45s var(--lv-spring), box-shadow 0.45s var(--lv-ease);
  cursor: pointer;
}

.lv-hero__icon svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lv-hero__icon svg .fill {
  fill: currentColor;
  stroke: none;
}

.lv-hero__app:hover .lv-hero__icon,
.lv-hero__app:focus-visible .lv-hero__icon {
  transform: scale(1.18) rotate(-6deg);
  box-shadow: 0 16px 60px -4px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.lv-hero__label {
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  padding: 5px 10px;
  color: #fff;
  font: 600 13px/1 var(--sans, sans-serif);
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  opacity: 0;
  translate: -50% -4px;
  transition: opacity 0.25s, translate 0.35s var(--lv-ease);
  pointer-events: none;
}

.lv-hero__app:hover .lv-hero__label,
.lv-hero__app:focus-visible .lv-hero__label,
.lv-hero.is-tour .lv-hero__app.is-tour .lv-hero__label {
  opacity: 1;
  translate: -50% 0;
}

.lv-hero.is-tour .lv-hero__app.is-tour .lv-hero__icon {
  transform: scale(1.12);
}

.lv-hero__app:focus-visible {
  outline: none;
}

@keyframes lv-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* Entrance: icons spring out from the centre the first time the hero is seen */
.lv-hero:not(.is-in) .lv-hero__app {
  left: 50%;
  top: 50%;
  opacity: 0;
}

.lv-hero .lv-hero__app {
  transition: translate 0.6s var(--lv-ease), left 1s var(--lv-spring), top 1s var(--lv-spring), opacity 0.5s;
  transition-delay: 0s, var(--in, 0s), var(--in, 0s), var(--in, 0s);
}

.lv-hero:not(.is-in) .lv-hero__lines {
  opacity: 0;
}

.lv-hero__lines {
  transition: opacity 0.8s 0.6s;
}

/* =========================================================
   2. Name tiles
   ========================================================= */

/* Verve: flowing gradient, letters bounce when hovered */
.lv-tiles .ap-tile__media--verve span {
  display: inline-flex;
  background-size: 300% 100%;
  animation: lv-sheen 6s ease-in-out infinite alternate;
}

.lv-tiles .ap-tile__media--verve b {
  display: inline-block;
  font-weight: inherit;
  background: inherit;
  background-size: 500% 100%;
  background-position: calc(var(--i) * 25%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  transition: transform 0.5s var(--lv-spring);
  transition-delay: calc(var(--i) * 0.04s);
}

.lv-tiles .ap-tile:hover .ap-tile__media--verve b {
  transform: translateY(-14%) rotate(calc((var(--i) - 2) * 3deg));
}

@keyframes lv-sheen {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

/* Stac: the four chips stack in one after another, and lift on hover */
.lv-tiles .ap-chip {
  display: inline-flex;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  transition: transform 0.6s var(--lv-spring), opacity 0.4s;
}

.lv-tiles.is-live .ap-chip {
  opacity: 1;
  transform: none;
}

.lv-tiles.is-live .ap-chip--blue { transition-delay: 0.2s; }
.lv-tiles.is-live .ap-chip--pink { transition-delay: 0.45s; }
.lv-tiles.is-live .ap-chip--green { transition-delay: 0.7s; }
.lv-tiles.is-live .ap-chip--orange { transition-delay: 0.95s; }

.lv-tiles .ap-chip:hover {
  transform: translateY(-4px) rotate(-2deg) scale(1.04);
  transition-delay: 0s;
}

/* Noticed: buzzwords drift; hover cuts through them */
.lv-tiles .ap-noise span {
  display: inline-block;
  animation: lv-drift var(--dur, 7s) ease-in-out infinite alternate;
  animation-delay: var(--del, 0s);
  transition: transform 0.7s var(--lv-ease), opacity 0.5s, filter 0.5s;
}

@keyframes lv-drift {
  from { translate: 0 0; }
  to { translate: var(--dx, 6px) var(--dy, -4px); }
}

.lv-tiles .ap-tile:hover .ap-noise span {
  opacity: 0.08;
  filter: blur(6px);
  transform: translate(var(--ox, 0), var(--oy, 0)) scale(0.8);
}

.lv-tiles .ap-signal {
  transition: transform 0.6s var(--lv-spring), text-shadow 0.5s;
}

.lv-tiles .ap-signal::after {
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s var(--lv-ease) 0.5s;
}

.lv-tiles.is-live .ap-signal::after {
  transform: scaleX(1);
}

.lv-tiles .ap-tile:hover .ap-signal {
  transform: scale(1.06);
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.45);
}

/* =========================================================
   3. Process scenes
   ========================================================= */
.lv-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lv-step {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: radial-gradient(70% 70% at 50% 50%, rgba(255, 255, 255, 0.04), transparent), #14213d;
  border-radius: 4px;
}

.lv-step__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 78% 22%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 64% 80%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 12% 74%, rgba(255, 255, 255, 0.4), transparent);
}

.lv-step__tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.5);
  font: 400 15px/1 var(--sans, sans-serif);
}

/* Shared mini window */
.lv-win {
  position: relative;
  width: 58%;
  padding: 7% 7% 6%;
  background: #1e2f54;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
}

.lv-win__dots {
  display: flex;
  gap: 4px;
  margin-bottom: 9%;
}

.lv-win__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c98442;
}

.lv-win__dots i:nth-child(2) { background: #febc2e; }
.lv-win__dots i:nth-child(3) { background: #e6ad61; }

.lv-bar {
  display: block;
  height: 5px;
  margin-top: 7%;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

.lv-bar--title {
  width: 52%;
  height: 7px;
  margin-top: 0;
  background: #fff;
}

/* Understand: a magnifier sweeps the brief and the key line lights up */
.lv-understand .lv-bar--key {
  position: relative;
  overflow: hidden;
}

.lv-understand .lv-bar--key::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffc21a;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  animation: lv-key 5s var(--lv-ease) infinite;
}

@keyframes lv-key {
  0%, 38% { transform: scaleX(0); }
  55%, 88% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

.lv-glass {
  position: absolute;
  top: 18%;
  left: 18%;
  width: 34%;
  aspect-ratio: 1;
  border: 3px solid transparent;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(70, 70, 80, 0.75), rgba(22, 22, 26, 0.6)) padding-box,
    conic-gradient(from 200deg, #c98442, #c98442, #8398c6, #5577b8, #c98442) border-box;
  box-shadow: 0 0 30px rgba(131, 152, 198, 0.45);
  backdrop-filter: blur(1.5px) brightness(1.3);
  animation: lv-scan 5s var(--lv-ease) infinite;
}

.lv-glass::after {
  content: "";
  position: absolute;
  right: -26%;
  bottom: -26%;
  width: 34%;
  height: 7%;
  background: #fff;
  border-radius: 4px;
  transform: rotate(45deg);
}

@keyframes lv-scan {
  0% { transform: translate(-30%, -20%); }
  25% { transform: translate(60%, 10%); }
  45%, 85% { transform: translate(120%, 62%); }
  100% { transform: translate(-30%, -20%); }
}

.lv-step:hover .lv-glass {
  animation-duration: 2.5s;
}

/* Build: four layers drop in and stack; hover pulls them apart */
.lv-stack {
  position: relative;
  width: 40%;
  aspect-ratio: 1;
  transform: translateY(10%);
}

.lv-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--a), var(--b));
  border-radius: 18%;
  transform: translateY(calc(var(--i) * -13%)) rotateX(58deg) rotateZ(45deg);
  box-shadow: 0 6px 0 var(--edge), 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  animation: lv-drop 4.8s var(--lv-spring) infinite;
  animation-delay: calc(var(--i) * 0.18s);
  transition: transform 0.6s var(--lv-spring);
}

.lv-layer--top::after {
  content: "";
  position: absolute;
  inset: 26% 22%;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 14% no-repeat,
    linear-gradient(#fff, #fff) 0 50% / 100% 14% no-repeat,
    linear-gradient(#fff, #fff) 0 100% / 100% 14% no-repeat;
  opacity: 0.9;
  transform: rotate(-90deg);
}

@keyframes lv-drop {
  0% { translate: 0 -120%; opacity: 0; }
  14% { translate: 0 0; opacity: 1; }
  86% { translate: 0 0; opacity: 1; }
  100% { translate: 0 -40%; opacity: 0; }
}

.lv-step:hover .lv-layer {
  transform: translateY(calc(var(--i) * -26%)) rotateX(58deg) rotateZ(45deg);
}

/* Improve: the trend line draws, bars grow and the up badge pops */
.lv-improve .lv-win {
  width: 64%;
}

.lv-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 6%;
  overflow: visible;
}

.lv-chart path {
  fill: none;
  stroke: url(#lv-trend);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: lv-draw 4.6s var(--lv-ease) infinite;
}

.lv-chart .lv-chart__area {
  fill: url(#lv-trend-area);
  stroke: none;
  opacity: 0;
  animation: lv-area 4.6s ease infinite;
}

.lv-chart circle {
  fill: #fff;
  opacity: 0;
  animation: lv-dot 4.6s ease infinite;
}

@keyframes lv-draw {
  0% { stroke-dashoffset: 260; }
  45%, 90% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 260; }
}

@keyframes lv-area {
  0%, 30% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lv-dot {
  0%, 42% { opacity: 0; r: 0; }
  50%, 90% { opacity: 1; r: 4; }
  100% { opacity: 0; r: 0; }
}

.lv-growth {
  display: flex;
  align-items: flex-end;
  gap: 4%;
  height: 22px;
  margin-top: 6%;
}

.lv-growth i {
  width: 7%;
  height: var(--h);
  background: #e6ad61;
  border-radius: 2px;
  transform-origin: bottom;
  animation: lv-grow 4.6s var(--lv-spring) infinite;
  animation-delay: calc(var(--i) * 0.12s);
}

@keyframes lv-grow {
  0%, 10% { transform: scaleY(0); }
  35%, 90% { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

.lv-badge {
  position: absolute;
  top: -14%;
  right: 6%;
  display: grid;
  place-items: center;
  width: 17%;
  aspect-ratio: 1;
  color: #fff;
  background: #e6ad61;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(230, 173, 97, 0.6);
  animation: lv-pop 4.6s var(--lv-spring) infinite;
}

.lv-badge svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes lv-pop {
  0%, 45% { transform: scale(0); }
  55%, 90% { transform: scale(1); }
  100% { transform: scale(0); }
}

.lv-step:hover .lv-badge {
  box-shadow: 0 0 40px rgba(230, 173, 97, 0.9);
}

/* ---------- Small screens ---------- */
@media (max-width: 1023px) {
  .lv-hero {
    aspect-ratio: 4 / 3;
  }

  .lv-hero__core {
    width: 30%;
  }

  .lv-hero__app {
    --s: 13% !important;
  }

  .lv-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lv *,
  .lv *::before,
  .lv *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .lv-chart path { stroke-dashoffset: 0; }
  .lv-chart circle, .lv-chart .lv-chart__area { opacity: 1; }
  .lv-badge, .lv-growth i { transform: none; }
}
