.reveal {
  opacity: 1;
  filter: none;
  transform: none;
  transition: none;
}

.signal-wave i {
  animation: pulse 2.4s ease-in-out infinite alternate;
}

/* Data visualizations animate once when their section enters view. */
.reveal .platform-list i {
  position: relative;
  overflow: hidden;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.05s cubic-bezier(.18, .8, .22, 1);
}

.reveal.is-visible .platform-list i { transform: scaleX(1); }
.platform-list > div:nth-child(2) i { transition-delay: .08s; }
.platform-list > div:nth-child(3) i { transition-delay: .16s; }
.platform-list > div:nth-child(4) i { transition-delay: .24s; }
.platform-list > div:nth-child(5) i { transition-delay: .32s; }

.reveal.is-visible .platform-list i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .6) 50%, transparent 100%);
  transform: translateX(-130%);
  animation: chart-sweep 3.4s ease-in-out 1.1s infinite;
}

.reveal.is-visible .dashboard__stats > div {
  animation: metric-drift 3.8s ease-in-out 1.05s infinite alternate;
}

.reveal.is-visible .dashboard__stats > div:nth-child(2) { animation-delay: 1.35s; }
.reveal.is-visible .dashboard__stats > div:nth-child(3) { animation-delay: 1.65s; }

@keyframes chart-sweep {
  0%, 28% { transform: translateX(-130%); }
  62%, 100% { transform: translateX(130%); }
}

@keyframes metric-drift {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

@property --quota-fill {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.reveal .ring {
  --quota-fill: 0;
  background: conic-gradient(var(--teal) calc(var(--quota-fill) * 1%), rgba(255, 255, 255, .1) 0);
  transform: scale(.94);
  transition: --quota-fill 1.65s cubic-bezier(.4, 0, .2, 1), transform 1.65s cubic-bezier(.4, 0, .2, 1);
}

.reveal.is-visible .ring {
  --quota-fill: 72;
  transform: scale(1);
}

.reveal.is-visible .ring > div {
  animation: quota-breathe 3.6s ease-in-out 1.3s infinite alternate;
}

@keyframes quota-breathe {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(106, 216, 200, 0); }
  to { transform: scale(1.035); box-shadow: 0 0 34px rgba(106, 216, 200, .14); }
}

footer {
  grid-template-columns: minmax(0, 1fr) auto;
}

footer nav {
  justify-content: flex-start;
  flex-wrap: wrap;
}

footer p {
  margin: 0;
  text-align: right;
}

/* Soft color handoffs make the sections read as one continuous page. */
.section__inner { position: relative; z-index: 2; }

.section + .section::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: clamp(190px, 26vw, 360px);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--edge-from) 50%, var(--edge-to)) 0%,
    color-mix(in srgb, var(--edge-from) 38%, var(--edge-to)) 28%,
    color-mix(in srgb, var(--edge-from) 22%, var(--edge-to)) 58%,
    color-mix(in srgb, var(--edge-from) 9%, var(--edge-to)) 82%,
    var(--edge-to) 100%
  );
}

.section:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: clamp(190px, 26vw, 360px);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--edge-out-from) 0%,
    color-mix(in srgb, var(--edge-out-from) 91%, var(--edge-out-to)) 18%,
    color-mix(in srgb, var(--edge-out-from) 78%, var(--edge-out-to)) 42%,
    color-mix(in srgb, var(--edge-out-from) 62%, var(--edge-out-to)) 72%,
    color-mix(in srgb, var(--edge-out-from) 50%, var(--edge-out-to)) 100%
  );
}

main .section:nth-child(2) { --edge-from: #101933; --edge-to: #f4f0e7; }
main .section:nth-child(3) { --edge-from: #f4f0e7; --edge-to: #07090d; }
main .section:nth-child(4) { --edge-from: #07090d; --edge-to: #092783; }
main .section:nth-child(5) { --edge-from: #07122f; --edge-to: #f4f0e7; }
main .section:nth-child(6) { --edge-from: #f4f0e7; --edge-to: #07090d; }
main .section:nth-child(7) { --edge-from: #07090d; --edge-to: #f4f0e7; }
main .section:nth-child(8) { --edge-from: #f4f0e7; --edge-to: #07090d; }

main .section:nth-child(1) { --edge-out-from: #101933; --edge-out-to: #f4f0e7; }
main .section:nth-child(2) { --edge-out-from: #f4f0e7; --edge-out-to: #07090d; }
main .section:nth-child(3) { --edge-out-from: #07090d; --edge-out-to: #092783; }
main .section:nth-child(4) { --edge-out-from: #07122f; --edge-out-to: #f4f0e7; }
main .section:nth-child(5) { --edge-out-from: #f4f0e7; --edge-out-to: #07090d; }
main .section:nth-child(6) { --edge-out-from: #07090d; --edge-out-to: #f4f0e7; }
main .section:nth-child(7) { --edge-out-from: #f4f0e7; --edge-out-to: #07090d; }

@media (max-width: 900px) {
  footer {
    grid-template-columns: 1fr;
  }

  footer p { text-align: left; }
}

@media (max-width: 620px) {
  footer nav { justify-content: center; }
  footer p { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal .platform-list i {
    transform: scaleX(1);
    transition: none;
  }

  .reveal .ring {
    --quota-fill: 72;
    transform: none;
    animation: none;
    transition: none;
  }

  .signal-wave i,
  .reveal.is-visible .platform-list i::after,
  .reveal.is-visible .dashboard__stats > div,
  .reveal.is-visible .ring > div {
    animation: none;
  }
}

/* Light section handoffs follow the same palette as their section backgrounds. */
html[data-theme='light'] main .section--light { background-color: #f4f0e7; }

html[data-theme='light'] main .section:nth-child(2) { --edge-from: #e6edf9; --edge-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(3) { --edge-from: #f4f0e7; --edge-to: #f4f7f8; }
html[data-theme='light'] main .section:nth-child(4) { --edge-from: #f4f7f8; --edge-to: #e2eafa; }
html[data-theme='light'] main .section:nth-child(5) { --edge-from: #f4f7f8; --edge-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(6) { --edge-from: #f4f0e7; --edge-to: #f4f7f8; }
html[data-theme='light'] main .section:nth-child(7) { --edge-from: #f4f7f8; --edge-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(8) { --edge-from: #f4f0e7; --edge-to: #f4f7f8; }

html[data-theme='light'] main .section:nth-child(1) { --edge-out-from: #e6edf9; --edge-out-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(2) { --edge-out-from: #f4f0e7; --edge-out-to: #f4f7f8; }
html[data-theme='light'] main .section:nth-child(3) { --edge-out-from: #f4f7f8; --edge-out-to: #e2eafa; }
html[data-theme='light'] main .section:nth-child(4) { --edge-out-from: #f4f7f8; --edge-out-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(5) { --edge-out-from: #f4f0e7; --edge-out-to: #f4f7f8; }
html[data-theme='light'] main .section:nth-child(6) { --edge-out-from: #f4f7f8; --edge-out-to: #f4f0e7; }
html[data-theme='light'] main .section:nth-child(7) { --edge-out-from: #f4f0e7; --edge-out-to: #f4f7f8; }

/* Keep the animated monthly quota readable in the light theme. */
html[data-theme='light'] main .ring {
  background: conic-gradient(#168574 calc(var(--quota-fill) * 1%), #d8e5e2 0);
}
html[data-theme='light'] main .ring > div {
  background: #fff;
  color: #13212b;
}
html[data-theme='light'] main .ring span { color: #52606b; }
