/* FlightAssist — Proven at scale: square glass cards + blended section edges */
.proof-scale-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: clamp(66px, 6.2vw, 92px) 0 clamp(72px, 6.5vw, 96px);
  background: var(--navy-950);
}

/* The color field is masked at both ends so the section melts into the page. */
.proof-scale-section::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 52% 76% at 92% 46%, rgba(37, 191, 247, .20) 0%, transparent 72%),
    radial-gradient(ellipse 48% 78% at 8% 22%, rgba(165, 151, 252, .19) 0%, transparent 74%),
    linear-gradient(135deg, rgba(234, 244, 252, .96) 0%, rgba(220, 234, 250, .98) 48%, rgba(237, 244, 252, .96) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 13%, #000 87%, transparent 100%);
}

.proof-scale-container {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - clamp(40px, 7.2vw, 120px)));
  max-width: 1240px;
  margin: 0 auto;
}

.proof-scale-header {
  position: relative;
  z-index: 2;
  max-width: 850px;
  margin: 0 auto clamp(36px, 3.6vw, 54px);
  text-align: center;
}

.proof-scale-eyebrow {
  display: inline-flex;
  justify-content: center;
  color: #2c6ca8;
  letter-spacing: .11em;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.proof-scale-title {
  margin: 14px 0 16px;
  color: #1b3553;
  font-size: clamp(2.25rem, 4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 750;
}

.proof-scale-subtitle {
  max-width: 820px;
  margin: 0 auto;
  color: #53677f;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.75;
}

.proof-scale-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
  align-items: stretch;
}

.proof-stat-card {
  --proof-card-surface: rgba(255, 255, 255, .48);
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.45vw, 18px);
  padding: clamp(18px, 2vw, 30px);
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(37, 191, 247, .34);
  border-radius: clamp(18px, 1.8vw, 24px);
  background: transparent;
  box-shadow: 0 14px 34px rgba(32, 76, 126, .09);
  -webkit-backdrop-filter: blur(15px) saturate(1.05);
  backdrop-filter: blur(15px) saturate(1.05);
  transition: border-color .28s ease, box-shadow .32s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

.proof-stat-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--proof-card-surface);
  pointer-events: none;
}

.proof-stat-card:hover {
  border-color: rgba(165, 151, 252, .82);
  box-shadow: 0 20px 44px rgba(32, 76, 126, .14), 0 0 25px rgba(37, 191, 247, .11);
  transform: translateY(-5px);
}

.proof-stat-value {
  position: relative;
  z-index: 1;
  display: block;
  color: transparent;
  background: linear-gradient(125deg, #3d70d6 0%, #665ee0 52%, #8f78eb 74%, #25aee9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.15rem, 3.1vw, 2.8rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.proof-stat-label {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 230px;
  color: #53677f;
  font-size: clamp(.85rem, 1.05vw, .98rem);
  line-height: 1.6;
}

/* The globe remains visible even if WebGL fails; Cobe replaces this CSS fallback when ready. */
.proof-earth-wrap {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: max(-5.5%, calc((100vw - 1440px) / -2));
  width: clamp(470px, 47vw, 660px);
  max-width: 60vw;
  aspect-ratio: 1;
  opacity: .94;
  transform: translate3d(0, -50%, 0) scale(1);
  transform-origin: center;
  transition: opacity 1s cubic-bezier(.22, 1, .36, 1), transform 1.1s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
  filter: drop-shadow(0 0 65px rgba(94, 184, 255, .30)) drop-shadow(0 0 36px rgba(165, 151, 252, .25));
}

/* Fallback globe keeps the section's visual present if WebGL/Cobe cannot initialize. */
.proof-earth-wrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 3%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, .98) 0%, rgba(222, 239, 255, .86) 38%, rgba(165, 151, 252, .32) 67%, rgba(37, 191, 247, .25) 72%, rgba(37, 191, 247, .04) 75%, transparent 76%),
    radial-gradient(circle, rgba(24, 58, 94, .58) 1.05px, transparent 1.45px) center / 8px 8px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 56%, transparent 72%);
  box-shadow: inset -22px -10px 42px rgba(37, 191, 247, .14), inset 14px 8px 32px rgba(255, 255, 255, .58), 0 0 60px rgba(37, 191, 247, .16);
  opacity: .88;
  animation: proof-earth-fallback-spin 70s linear infinite;
  transition: opacity .5s ease;
}

.proof-scale-section.proof-globe-ready .proof-earth-wrap::before {
  opacity: 0;
  animation: none;
}

@keyframes proof-earth-fallback-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.proof-earth-wrap > div {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(22px) scale(.97);
  transform-origin: center;
  transition: opacity 1.1s cubic-bezier(.22, 1, .36, 1), transform 1.1s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}

.proof-earth-wrap canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transform: scale(1);
  transition: opacity .75s ease, transform .2s ease;
}

.proof-scale-section.proof-globe-visible .proof-earth-wrap {
  opacity: .96;
  transform: translate3d(0, -50%, 0) scale(1);
}

.proof-scale-section.proof-globe-visible .proof-earth-wrap > div {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Fail-open defaults: section content stays visible when the animation module is unavailable. */
.proof-scale-section [data-proof-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity .78s cubic-bezier(.22, 1, .36, 1), transform .78s cubic-bezier(.22, 1, .36, 1), filter .78s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--proof-reveal-delay, 0ms);
}

/* The JS adds proof-motion-ready only after it has found the section and installed observers. */
.proof-scale-section.proof-motion-ready [data-proof-reveal]:not(.proof-revealed) {
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(.975);
  filter: blur(3px);
  will-change: opacity, transform;
}

.proof-scale-section.proof-motion-ready [data-proof-reveal].proof-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
  will-change: auto;
}

:root[data-theme="dark"] .proof-scale-section::before {
  background:
    radial-gradient(ellipse 54% 80% at 92% 46%, rgba(37, 191, 247, .14) 0%, transparent 73%),
    radial-gradient(ellipse 48% 78% at 8% 22%, rgba(165, 151, 252, .15) 0%, transparent 74%),
    linear-gradient(135deg, rgba(10, 23, 41, .98) 0%, rgba(17, 39, 66, .98) 48%, rgba(12, 28, 49, .98) 100%);
}
:root[data-theme="dark"] .proof-scale-eyebrow { color: #8fcaff; }
:root[data-theme="dark"] .proof-scale-title { color: #f1f6ff; }
:root[data-theme="dark"] .proof-scale-subtitle { color: rgba(224, 235, 250, .78); }
:root[data-theme="dark"] .proof-stat-card {
  --proof-card-surface: rgba(255, 255, 255, .075);
  border-color: rgba(148, 197, 255, .23);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}
:root[data-theme="dark"] .proof-stat-card:hover {
  border-color: rgba(165, 151, 252, .7);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .3), 0 0 25px rgba(37, 191, 247, .1);
}
:root[data-theme="dark"] .proof-stat-label { color: rgba(226, 232, 240, .82); }
:root[data-theme="dark"] .proof-earth-wrap { opacity: .88; }
:root[data-theme="dark"] .proof-earth-wrap::before { opacity: .62; }
:root[data-theme="dark"] .proof-scale-section.proof-globe-ready .proof-earth-wrap::before { opacity: 0; }
:root[data-theme="dark"] .proof-scale-section.proof-globe-visible .proof-earth-wrap { opacity: .76; }
:root[data-theme="dark"] .proof-stat-value {
  background: linear-gradient(125deg, #7ecaff 0%, #5eb8ff 24%, #7b93ff 57%, #a594ff 80%, #cbb8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@media (max-width: 980px) {
  .proof-scale-section { padding: 70px 0 76px; }
  .proof-scale-container { width: min(760px, calc(100% - 40px)); }
  .proof-scale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .proof-stat-card { border-radius: 22px; }
  .proof-earth-wrap { right: -22%; width: 540px; max-width: none; opacity: .46; }
  :root[data-theme="dark"] .proof-earth-wrap { opacity: .38; }
  .proof-scale-header { margin-bottom: 36px; }
}

@media (max-width: 560px) {
  .proof-scale-section { padding: 58px 0 64px; }
  .proof-scale-container { width: min(360px, calc(100% - 32px)); }
  .proof-scale-header { margin-bottom: 28px; }
  .proof-scale-title { font-size: clamp(2.15rem, 9vw, 2.85rem); }
  .proof-scale-subtitle { font-size: .98rem; line-height: 1.7; }
  .proof-scale-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .proof-stat-card { aspect-ratio: 1 / 1; padding: 24px; }
  .proof-stat-value { font-size: 2.65rem; }
  .proof-stat-label { font-size: .95rem; }
  .proof-earth-wrap { top: 46%; right: -65%; width: 125vw; max-width: none; opacity: .28; }
  .proof-scale-section.proof-globe-visible .proof-earth-wrap { transform: translate3d(0, -50%, 0) scale(1); }
  :root[data-theme="dark"] .proof-earth-wrap { opacity: .2; }
}

@media (prefers-reduced-motion: reduce) {
  .proof-scale-section.proof-motion-ready [data-proof-reveal] {
    transition-duration: .68s !important;
  }
  .proof-earth-wrap,
  .proof-earth-wrap > div,
  .proof-earth-wrap canvas,
  .proof-stat-card {
    transition: none !important;
  }
  .proof-stat-card:hover { transform: none; }
}


/* Module cards: remove the photo backgrounds and restore the clean FlightAssist surface. */
.module-showcase .module-grid > .module-card {
  min-height: 390px !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  background: linear-gradient(155deg, var(--surface), var(--surface-2)) !important;
  box-shadow: 0 16px 38px rgba(18, 66, 98, .08) !important;
}
.module-grid > .module-card:nth-child(1)::before,
.module-grid > .module-card:nth-child(2)::before,
.module-grid > .module-card:nth-child(3)::before,
.module-grid > .module-card:nth-child(4)::before {
  display: none !important;
  content: none !important;
  background-image: none !important;
}
.module-showcase .module-grid > .module-card::after {
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: -70px !important;
  bottom: -80px !important;
  width: 190px !important;
  height: 190px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(37, 191, 247, .35), rgba(165, 151, 252, .16) 48%, transparent 72%) !important;
  z-index: 0 !important;
}
.module-showcase .module-grid > .module-card > * {
  z-index: 1 !important;
}
.module-showcase .module-grid > .module-card > .module-number {
  color: var(--muted) !important;
  text-shadow: none !important;
}
.module-showcase .module-grid > .module-card > .icon {
  color: var(--sky-400) !important;
  filter: none !important;
}
.module-showcase .module-grid > .module-card h3 {
  color: var(--ink) !important;
  text-shadow: none !important;
}
.module-showcase .module-grid > .module-card p {
  color: var(--muted) !important;
  text-shadow: none !important;
}
.module-showcase .module-grid > .module-card .card-link,
.module-showcase .module-grid > .module-card .card-link .icon {
  color: var(--blue-500) !important;
  text-shadow: none !important;
}
.module-showcase .module-grid > .module-card:hover {
  border-color: rgba(165, 151, 252, .75) !important;
}

/* Never let the OS-level reduced-motion rule accidentally freeze the requested globe/cards. */
@media (prefers-reduced-motion: reduce) {
  .proof-scale-section [data-proof-reveal] {
    transition-duration: .68s !important;
  }
  .proof-scale-section.proof-globe-visible .proof-earth-wrap,
  .proof-earth-wrap,
  .proof-earth-wrap > div,
  .proof-earth-wrap canvas {
    transition-duration: .9s !important;
  }
}
@media (max-width: 820px) {
  .module-showcase .module-grid > .module-card { min-height: 360px !important; }
}
@media (max-width: 560px) {
  .module-showcase .module-grid > .module-card { min-height: 340px !important; }
}
