/* Landing motion: the night-sky "What we check" band and the "How an audit runs" stepper.
   Everything works with no JavaScript and with reduced motion: the final state is the default.
   Controllers add .is-armed (the hidden starting state) and then .is-live / .is-active, and only
   when the visitor has not asked for reduced motion. */

:root {
  --teal-light: #6CC7D6;
}

/* Night sky --------------------------------------------------------- */
.band--sky { position: relative; overflow: hidden; isolation: isolate; }
.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sky__layer {
  position: absolute;
  left: 0;
  top: -18%;
  width: 100%;
  height: 136%;
  fill: #DDE4F2;
  will-change: transform;
}
.sky__layer--far { opacity: 0.5; }
.sky__layer--mid { opacity: 0.75; }
.sky__layer--near { fill: #F1EBFD; opacity: 0.95; }
.sky__content { position: relative; }
.sky__layer--far { --shift: 60; }
.sky__layer--mid { --shift: 140; }
.sky__layer--near { --shift: 260; }
.band--sky { view-timeline: --sky block; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sky__layer { animation: sky-shift linear both; animation-timeline: --sky; animation-range: cover; }
  }
}
@keyframes sky-shift {
  from { transform: translate3d(0, calc(var(--shift) * 1px), 0); }
  to { transform: translate3d(0, calc(var(--shift) * -1px), 0); }
}

.band--sky .service-index { border-top-color: var(--night-line); }
.band--sky .service-index__item { border-bottom-color: var(--night-line); }
.band--sky .service-index__name { color: var(--surface); }
.band--sky .service-index__desc { color: var(--night-text); }
.band--sky .service-index__tier { color: var(--teal-light); }
.band--sky .service-index__tier--growth { color: var(--night-accent); }
.band--sky .service-index__tier--complete { color: var(--violet-light); }

/* The constellation that becomes a graph */
.skyline { margin: 0 0 var(--s4); }
.skyline__svg { display: block; width: 100%; height: auto; overflow: visible; }
.skyline__grid line { stroke: var(--night-line); stroke-width: 1; stroke-dasharray: 3 7; }
.skyline__grid .skyline__axis { stroke: #3A4B72; stroke-dasharray: none; }
.skyline__area { fill: var(--violet); fill-opacity: 0.16; }
.skyline__line {
  fill: none;
  stroke: var(--violet-light);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.skyline__star { fill: #F1EBFD; transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 5px rgb(183 156 245 / 0.85)); }
.skyline__star--last { fill: #FFFFFF; filter: drop-shadow(0 0 9px rgb(183 156 245 / 1)); }
.skyline__halo { fill: var(--violet-light); fill-opacity: 0; transform-box: fill-box; transform-origin: center; }

.skyline__star--i0 { --dx: -46px; --dy: -70px; --i: 0; }
.skyline__star--i1 { --dx: 38px; --dy: -96px; --i: 1; }
.skyline__star--i2 { --dx: -30px; --dy: -120px; --i: 2; }
.skyline__star--i3 { --dx: 54px; --dy: -60px; --i: 3; }
.skyline__star--i4 { --dx: -62px; --dy: -110px; --i: 4; }
.skyline__star--i5 { --dx: 40px; --dy: -80px; --i: 5; }
.skyline__star--i6 { --dx: -28px; --dy: -130px; --i: 6; }

@media (prefers-reduced-motion: no-preference) {
  .star--twinkle { animation: twinkle 4.8s ease-in-out infinite; }
  .star--t1 { animation-delay: -1.2s; }
  .star--t2 { animation-delay: -2.4s; }
  .star--t3 { animation-delay: -3.6s; }

  .band--sky.is-armed .skyline__star { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
  .band--sky.is-armed .skyline__line { stroke-dashoffset: 1; }
  .band--sky.is-armed .skyline__area { opacity: 0; }

  .band--sky.is-live .skyline__star {
    animation: star-align 900ms cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--i) * 110ms) both;
  }
  .band--sky.is-live .skyline__line { animation: line-trace 1700ms cubic-bezier(0.45, 0, 0.2, 1) 900ms both; }
  .band--sky.is-live .skyline__area { animation: area-in 1000ms ease-out 2200ms both; }
  .band--sky.is-live .skyline__star--last {
    animation: star-align 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 660ms both, shine 3200ms ease-in-out 3300ms infinite;
  }
  .band--sky.is-live .skyline__halo { animation: halo 3200ms ease-out 3300ms infinite; }
}

@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes star-align {
  from { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
  to { opacity: 1; transform: none; }
}
@keyframes line-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes area-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shine { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.3); } }
@keyframes halo {
  0% { transform: scale(0.6); fill-opacity: 0.55; }
  70%, 100% { transform: scale(3); fill-opacity: 0; }
}

/* How an audit runs: a stepper that lights up in sequence ------------- */
.process__head { max-width: 46rem; }
.steps { list-style: none; display: grid; gap: var(--s3); margin-top: var(--s4); }

.steps__item {
  --step-gap: var(--s3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  transition: border-color 400ms ease;
}

.steps__node {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--s1);
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  transition: background-color 400ms ease, color 400ms ease;
}

.steps__art { width: 4rem; height: 3rem; margin-bottom: var(--s1); overflow: visible; }
.art-stroke { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }

.steps__item h3 { font-size: var(--text-md); }
.steps__item p { color: var(--muted); }
.steps__item:hover { border-color: var(--accent); }

@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
  .steps__item { --step-gap: var(--s4); padding: var(--s4) var(--s3) var(--s3); }
  /* connector from this node to the next one, with a fill that follows the activation */
  .steps__item:not(:last-child)::before,
  .steps__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(var(--s4) + 1.25rem - 1px);
    left: calc(var(--s3) + 3rem);
    width: calc(100% - 3.5rem + var(--step-gap) + var(--s3) - 0.25rem - 0.5rem);
    height: 2px;
    background: var(--line-strong);
  }
  .steps__item:not(:last-child)::after { background: var(--accent); transform: scaleX(0); transform-origin: left; }
}

@media (prefers-reduced-motion: no-preference) {
  .steps.is-armed .steps__node { border-color: var(--line-strong); color: var(--muted); }
  .steps.is-armed .art-stroke { stroke-dashoffset: 1; }

  .steps.is-armed .steps__item.is-active { border-color: var(--accent); }
  .steps.is-armed .steps__item.is-active .steps__node { background: var(--accent); border-color: var(--accent); color: var(--surface); }
  .steps.is-armed .steps__item.is-active .art-stroke { animation: line-trace 900ms cubic-bezier(0.45, 0, 0.2, 1) 150ms both; }
  .steps.is-armed .steps__item.is-active .art-delay { animation-delay: 650ms; }
  .steps.is-armed .steps__item.is-active .art-delay2 { animation-delay: 1000ms; }
  .steps.is-armed .steps__item.is-active::after { transform: scaleX(1); transition: transform 700ms cubic-bezier(0.45, 0, 0.2, 1) 500ms; }
}

/* Hero: a night sky with depth layers, a constellation that links up and shines -- */
.hero--night { background: var(--night); color: var(--night-text); }
.hero--night .hero__title { color: var(--surface); }
.hero--night .hero__lede { color: var(--night-text); }
.hero--night .hero__actions .text-link { color: var(--night-accent); }
.hero--night .hero__actions .text-link:hover { color: var(--surface); }
.hero--night .hero__actions .btn:focus-visible, .hero--night .hero__actions .text-link:focus-visible { box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--night-accent); }

.hero { position: relative; isolation: isolate; overflow: clip; }
.hero__panel { color: var(--ink); }
.hero__art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__layer { position: absolute; left: 0; top: -12%; width: 100%; height: 124%; will-change: transform; overflow: visible; }
/* Tall, narrow screens: keep the art at its natural size instead of blowing it up to fill the height. */
@media (max-aspect-ratio: 1/1) {
  .hero__layer { width: auto; height: 700px; top: 0; right: 0; margin-inline: auto; }
  .hero__layer--constellation { opacity: 0.55; }
}
.hero__layer--rings { fill: none; stroke: var(--night-accent); stroke-width: 1; opacity: 0.16; }
.hero__layer--dust { fill: #DDE4F2; opacity: 0.7; }
.hero__link { fill: none; stroke: var(--violet-light); stroke-width: 1.2; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0.7; }
.hero__shine { fill: #F1EBFD; transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 6px rgb(183 156 245 / 0.9)); }

@media (prefers-reduced-motion: no-preference) {
  .hero__layer--rings circle { transform-box: fill-box; transform-origin: center; animation: ring-breathe 9s ease-in-out infinite; }
  .hero__layer--rings circle:nth-of-type(2n) { animation-delay: -3s; }
  .hero__layer--rings circle:nth-of-type(3n) { animation-delay: -6s; }
  .hero__link { animation: link-trace 12s cubic-bezier(0.45, 0, 0.2, 1) infinite both; animation-delay: calc(var(--n) * 0.6s + 0.4s); }
  .hero__shine { animation: star-ping 12s ease-out infinite both; animation-delay: calc(var(--n) * 0.6s + 0.8s); }
}

.hero__n0 { --n: 0; } .hero__n1 { --n: 1; } .hero__n2 { --n: 2; } .hero__n3 { --n: 3; } .hero__n4 { --n: 4; }
.hero__n5 { --n: 5; } .hero__n6 { --n: 6; } .hero__n7 { --n: 7; } .hero__n8 { --n: 8; } .hero__n9 { --n: 9; }

@keyframes ring-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes link-trace {
  0% { stroke-dashoffset: 1; opacity: 0.8; }
  7% { stroke-dashoffset: 0; }
  82% { stroke-dashoffset: 0; opacity: 0.8; }
  94% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 1; opacity: 0; }
}
@keyframes star-ping {
  0% { transform: scale(0.55); opacity: 0.35; }
  2% { transform: scale(1.9); opacity: 1; }
  9% { transform: scale(1); opacity: 1; }
  45% { transform: scale(1.12); opacity: 0.85; }
  82% { transform: scale(1); opacity: 1; }
  94% { opacity: 0.35; }
  100% { transform: scale(0.55); opacity: 0.35; }
}

/* Scroll parallax runs on the scroll timeline itself, so it moves in step with the scroll. */
.hero__layer--rings { --shift: 80; }
.hero__layer--dust { --shift: 190; }
.hero__layer--constellation { --shift: 420; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .hero__layer { animation: hero-shift linear both; animation-timeline: scroll(root block); animation-range: 0 100vh; }
  }
}
@keyframes hero-shift { to { transform: translate3d(0, calc(var(--shift) * 1px), 0); } }

/* Complete package: a slow power-up glow ----------------------------- */
@property --glow-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

#packages { overflow-x: clip; } /* the glow must not add sideways scroll */
.package--complete { position: relative; box-shadow: 0 0 24px 0 rgb(109 40 217 / 0.22); }

@media (prefers-reduced-motion: no-preference) {
  .package--complete { animation: power-aura 3.4s ease-in-out infinite; }
  .package--complete::before {
    content: "";
    position: absolute;
    inset: -2px;
    padding: 2px;
    border-radius: calc(var(--radius-panel) + 2px);
    background: conic-gradient(from var(--glow-angle), transparent 0 62%, var(--violet-light) 80%, #FFFFFF 90%, var(--violet-light) 96%, transparent 100%);
    -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);
    mask-composite: exclude;
    animation: glow-spin 3.8s linear infinite;
    pointer-events: none;
  }
  .package--complete .package__name::before { animation: charge 3.4s ease-in-out infinite; }
}

@keyframes power-aura {
  0%, 100% { box-shadow: 0 0 18px 0 rgb(109 40 217 / 0.18), 0 0 0 0 rgb(183 156 245 / 0); }
  50% { box-shadow: 0 0 52px 10px rgb(124 58 237 / 0.5), 0 0 0 1px rgb(183 156 245 / 0.6); }
}
@keyframes glow-spin { to { --glow-angle: 360deg; } }
@keyframes charge { 0%, 100% { box-shadow: 0 0 0 0 rgb(109 40 217 / 0); } 50% { box-shadow: 0 0 10px 3px rgb(183 156 245 / 0.85); } }
