/*
 * V4 top-section fidelity layer.
 * Scoped to the header and hero so the remaining sections can be tuned independently.
 */

header {
  height: 51px;
  background: rgba(0, 15, 12, 0.9);
}

.nav-links {
  flex: 1;
  margin-left: 104px;
  gap: 27px;
}

.nav-links .nav-cta {
  width: 91px;
  height: 27px;
  margin-left: auto;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.brand-art {
  height: 42px;
}

.hero {
  gap: 83px;
  padding-top: 25px;
  padding-bottom: 5px;
}

.hero > div:first-child {
  position: relative;
}

.hero h1 {
  width: 410px;
  margin: 2px 0 19px;
  color: #f5f6f2;
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 33px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.field {
  height: 73px;
  margin-bottom: 13px;
  padding: 10px 13px 9px;
  border-color: #66ab42;
  background:
    radial-gradient(circle at 18% 60%, rgba(29, 93, 58, 0.2), transparent 48%),
    #092119;
  box-shadow:
    0 0 14px rgba(91, 190, 65, 0.12),
    inset 0 0 22px rgba(9, 66, 43, 0.28);
}

.field input {
  font-size: 25px;
  line-height: 1;
}

.scan-button {
  height: 46px;
  font-size: 20px;
  letter-spacing: 0.035em;
}

.hero.scan-active .field {
  border-color: #9df460;
  animation: scan-field-pulse 1.5s ease-in-out infinite alternate;
}

.hero.scan-active .scan-button {
  background: linear-gradient(100deg, #63cc35 0%, #b7ff78 46%, #72d93b 72%, #a4ef63 100%);
  background-size: 220% 100%;
  animation: scan-button-sweep 1.2s linear infinite;
}

@keyframes scan-field-pulse {
  from { box-shadow: 0 0 12px rgba(115, 223, 70, .12), inset 0 0 18px rgba(41, 128, 72, .2); }
  to { box-shadow: 0 0 24px rgba(137, 237, 78, .3), inset 0 0 28px rgba(53, 155, 82, .3); }
}

@keyframes scan-button-sweep {
  to { background-position: -220% 0; }
}

.scan-button svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.65;
}

.trust {
  grid-template-columns: 110px 129px max-content;
  justify-content: start;
  gap: 12px 0;
  margin-top: 21px;
  font-size: 9px;
}

.trust span:last-child {
  grid-column: auto;
  max-width: none;
  margin-left: 0;
}

.trust svg {
  width: 15px;
  height: 15px;
}

/*
 * V4 uses a loosely composed ecosystem rather than a mechanically even matrix.
 * The unequal columns and row rhythm preserve that controlled irregularity.
 */
.platform-area {
  top: -11px;
  margin-bottom: -18px;
}

.platform-area::before {
  left: -82px;
  top: 0;
  width: 82px;
  height: 479px;
  border: 0;
  opacity: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 82px 479px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='82' height='479' viewBox='0 0 82 479'%3E%3Cg fill='none' stroke='%238fe44c' stroke-width='1' stroke-linecap='round'%3E%3Cpath d='M2 149 C35 149 53 42 82 37' stroke-dasharray='2 3'/%3E%3Cpath d='M2 149 C33 149 55 118 82 122' stroke-dasharray='2 3' opacity='.82'/%3E%3Cpath d='M2 149 C34 150 50 200 82 210' stroke-dasharray='2 3' opacity='.64'/%3E%3Cpath d='M2 236 C34 236 54 282 82 294' stroke-dasharray='2 3' opacity='.78'/%3E%3Cpath d='M2 236 C39 236 46 360 82 380' stroke-dasharray='2 3' opacity='.52'/%3E%3Cpath d='M2 236 C36 236 48 430 82 452' stroke-dasharray='2 3' opacity='.32'/%3E%3C/g%3E%3Cg fill='%23aaf06a'%3E%3Ccircle cx='2.5' cy='149' r='3'/%3E%3Ccircle cx='2.5' cy='236' r='3'/%3E%3Ccircle cx='80' cy='37' r='1.8'/%3E%3Ccircle cx='80' cy='122' r='1.8'/%3E%3Ccircle cx='80' cy='210' r='1.8'/%3E%3Ccircle cx='80' cy='294' r='1.8'/%3E%3Ccircle cx='80' cy='380' r='1.8'/%3E%3Ccircle cx='80' cy='452' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
}

.flow-particles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}

.flow-particles i {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b4ff72;
  box-shadow: 0 0 5px #9eff5d, 0 0 11px rgba(126, 238, 74, .9);
  opacity: 0;
  offset-rotate: 0deg;
  animation: ecosystem-flow 6.8s linear infinite;
  animation-play-state: paused;
}

.platform-area.is-ready .flow-particles {
  opacity: .5;
}

.platform-area.is-ready .flow-particles i {
  animation-duration: 10s;
  animation-play-state: running;
}

.platform-area.is-scanning .flow-particles,
.platform-area.is-complete .flow-particles {
  opacity: 1;
}

.platform-area.is-scanning .flow-particles i {
  animation-duration: 4.8s;
  animation-play-state: running;
}

.platform-area.is-complete .flow-particles i {
  animation-duration: 8s;
  animation-play-state: running;
}

.progress i {
  transition: width .65s ease;
}

.flow-particles i:nth-child(1) { offset-path: path("M -80 149 C -45 149 -28 38 8 37"); }
.flow-particles i:nth-child(2) { offset-path: path("M -80 149 C -46 149 -25 118 8 122"); animation-delay: -1.2s; }
.flow-particles i:nth-child(3) { offset-path: path("M -80 149 C -44 150 -28 199 8 210"); animation-delay: -2.4s; }
.flow-particles i:nth-child(4) { offset-path: path("M -80 236 C -42 236 -25 282 8 294"); animation-delay: -3.4s; }
.flow-particles i:nth-child(5) { offset-path: path("M -80 236 C -38 236 -27 358 8 380"); animation-delay: -4.5s; }
.flow-particles i:nth-child(6) { offset-path: path("M -80 236 C -42 236 -26 430 8 452"); animation-delay: -5.6s; }

@keyframes ecosystem-flow {
  0% { offset-distance: 0%; opacity: 0; transform: scale(.55); }
  10% { opacity: 1; }
  70% { opacity: .95; transform: scale(1); }
  100% { offset-distance: 100%; opacity: 0; transform: scale(.5); }
}

.platform-grid {
  grid-template-columns: repeat(60, minmax(0, 1fr));
  grid-template-rows: 86px 78px 82px 75px 70px 82px;
  column-gap: 6px;
  row-gap: 7px;
}

.platform:nth-child(1) { grid-area: 1 / 1 / 2 / 19; }
.platform:nth-child(2) { grid-area: 1 / 19 / 2 / 33; }
.platform:nth-child(3) { grid-area: 1 / 33 / 2 / 47; }
.platform:nth-child(4) { grid-area: 1 / 47 / 2 / 61; }
.platform:nth-child(5) { grid-area: 2 / 1 / 3 / 16; }
.platform:nth-child(6) { grid-area: 2 / 16 / 3 / 28; }
.platform:nth-child(7) { grid-area: 2 / 28 / 3 / 38; }
.platform:nth-child(8) { grid-area: 2 / 38 / 3 / 50; }
.platform:nth-child(9) { grid-area: 2 / 50 / 3 / 61; }
.platform:nth-child(10) { grid-area: 3 / 1 / 4 / 18; }
.platform:nth-child(11) { grid-area: 3 / 18 / 4 / 31; }
.platform:nth-child(12) { grid-area: 3 / 31 / 4 / 47; }
.platform:nth-child(13) { grid-area: 3 / 47 / 4 / 61; }
.platform:nth-child(14) { grid-area: 4 / 1 / 5 / 16; }
.platform:nth-child(15) { grid-area: 4 / 16 / 5 / 27; }
.platform:nth-child(16) { grid-area: 4 / 27 / 5 / 41; }
.platform:nth-child(17) { grid-area: 4 / 41 / 5 / 51; }
.platform:nth-child(18) { grid-area: 4 / 51 / 5 / 61; }
.platform:nth-child(19) { grid-area: 5 / 1 / 6 / 11; }
.platform:nth-child(20) { grid-area: 5 / 11 / 6 / 21; }
.platform:nth-child(21) { grid-area: 5 / 21 / 6 / 31; }
.platform:nth-child(22) { grid-area: 5 / 31 / 6 / 41; }
.platform:nth-child(23) { grid-area: 5 / 41 / 6 / 51; }
.platform:nth-child(24) { grid-area: 5 / 51 / 6 / 61; }
.platform:nth-child(25) { grid-area: 6 / 1 / 7 / 19; }
.platform:nth-child(26) { grid-area: 6 / 19 / 7 / 36; }
.platform:nth-child(27) { grid-area: 6 / 36 / 7 / 50; }
.platform:nth-child(28) { grid-area: 6 / 50 / 7 / 61; }

.platform {
  width: 100%;
  height: 100%;
  padding: 7px 7px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  background:
    linear-gradient(145deg, rgba(10, 41, 31, 0.98), rgba(4, 24, 19, 0.98));
  box-shadow: inset 0 0 18px rgba(7, 62, 40, 0.16);
}

.platform-copy {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1px 0 8px;
}

.platform:nth-child(n + 1):nth-child(-n + 4) { transform: translateX(-4px); }
.platform:nth-child(n + 5):nth-child(-n + 9) { transform: translate(5px, 2px); }
.platform:nth-child(n + 10):nth-child(-n + 13) { transform: translate(-3px, -1px); }
.platform:nth-child(n + 14):nth-child(-n + 18) { transform: translate(6px, 2px); }
.platform:nth-child(n + 19):nth-child(-n + 24) { transform: translate(-4px, -2px); }
.platform:nth-child(n + 25):nth-child(-n + 28) { transform: translate(5px, 1px); }
.platform:nth-child(3n + 2) { rotate: -.35deg; }
.platform:nth-child(4n) { rotate: .35deg; }

.platform-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: auto;
}

.platform:nth-child(4n + 2) .platform-logo {
  width: 55px;
  height: 55px;
  margin: -4px;
}

.platform:nth-child(5n) .platform-logo {
  width: 49px;
  height: 49px;
  margin: -1px;
}

.platform:nth-child(1) {
  grid-template-columns: 74px minmax(0, 1fr);
  padding-inline: 7px;
}

.platform:nth-child(1) .platform-logo {
  width: 72px;
  height: 72px;
  margin: 0 0 0 -2px;
  filter: drop-shadow(0 0 10px rgba(66, 133, 244, .2));
}

.platform:nth-child(1) strong { font-size: 13px; }

.platform:nth-child(n + 2):nth-child(-n + 4),
.platform:nth-child(n + 10):nth-child(-n + 13),
.platform:nth-child(n + 25):nth-child(-n + 28) {
  grid-template-columns: 63px minmax(0, 1fr);
}

.platform:nth-child(n + 2):nth-child(-n + 4) .platform-logo,
.platform:nth-child(n + 10):nth-child(-n + 13) .platform-logo,
.platform:nth-child(n + 25):nth-child(-n + 28) .platform-logo {
  width: 61px;
  height: 61px;
  margin: 0;
}

.platform[data-platform="medium"] .platform-logo {
  filter: brightness(0) invert(1);
}

.platform[data-platform="betterbusinessbureau"] .platform-logo {
  width: 49px;
  height: 63px;
  margin-inline: 6px 8px;
}

.platform strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.05;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.platform small {
  font-size: 8px;
}

.scan-state {
  margin-top: 3px;
  font-size: 8px;
}

.progress {
  left: 58px;
  right: 7px;
  bottom: 5px;
}

.platform:nth-child(n + 5):nth-child(-n + 9),
.platform:nth-child(n + 14):nth-child(-n + 24) {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding-inline: 4px;
  text-align: center;
}

.platform:nth-child(n + 5):nth-child(-n + 9) .platform-copy,
.platform:nth-child(n + 14):nth-child(-n + 24) .platform-copy {
  width: 100%;
  min-height: 17px;
  align-self: end;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2px 7px;
}

.platform:nth-child(n + 5):nth-child(-n + 9) .platform-logo,
.platform:nth-child(n + 14):nth-child(-n + 18) .platform-logo,
.platform:nth-child(n + 5):nth-child(-n + 18):nth-child(4n + 2) .platform-logo,
.platform:nth-child(n + 5):nth-child(-n + 18):nth-child(5n) .platform-logo {
  width: 45px;
  height: 45px;
  margin: -3px 0 0;
}

.platform:nth-child(n + 19):nth-child(-n + 24) .platform-logo,
.platform:nth-child(n + 19):nth-child(-n + 24):nth-child(4n + 2) .platform-logo,
.platform:nth-child(n + 19):nth-child(-n + 24):nth-child(5n) .platform-logo {
  width: 40px;
  height: 40px;
  margin: -3px 0 0;
}

.platform:nth-child(n + 5):nth-child(-n + 9) small,
.platform:nth-child(n + 5):nth-child(-n + 9) .scan-state,
.platform:nth-child(n + 14):nth-child(-n + 18) small,
.platform:nth-child(n + 14):nth-child(-n + 18) .scan-state,
.platform:nth-child(n + 19):nth-child(-n + 24) small,
.platform:nth-child(n + 19):nth-child(-n + 24) .scan-state {
  display: none;
}

.platform:nth-child(n + 5):nth-child(-n + 9) strong,
.platform:nth-child(n + 14):nth-child(-n + 18) strong,
.platform:nth-child(n + 19):nth-child(-n + 24) strong {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-size: 10px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform:nth-child(n + 5):nth-child(-n + 9) .progress,
.platform:nth-child(n + 14):nth-child(-n + 18) .progress,
.platform:nth-child(n + 19):nth-child(-n + 24) .progress {
  left: 6px;
}

.legend {
  justify-content: flex-start;
  gap: 14px;
  margin-top: 14px;
  font-size: 9px;
}

@media (max-width: 900px) and (min-width: 701px) {
  .hero h1 {
    font-size: clamp(29px, 3.82vw, 33px);
  }
}

@media (max-width: 700px) {
  .nav-links {
    flex: 0 0 auto;
    margin-left: 0;
  }

  .hero {
    padding-top: 24px;
  }

  .hero h1 {
    width: auto;
    margin-top: 0;
    font-size: 40px;
    white-space: normal;
  }

  .trust {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .trust span:last-child {
    grid-column: auto;
    margin-left: 0;
  }

  .platform-area {
    top: 0;
    margin-bottom: 0;
  }

  .flow-particles {
    display: none;
  }

  .platform-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: none;
    gap: 8px;
  }

  .platform {
    height: 76px;
    grid-column: auto !important;
    grid-row: auto !important;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: 1fr;
    transform: none !important;
    text-align: left;
    place-items: stretch center;
  }

  .platform-copy,
  .platform:nth-child(n + 5):nth-child(-n + 9) .platform-copy,
  .platform:nth-child(n + 14):nth-child(-n + 24) .platform-copy {
    width: auto;
    min-height: 0;
    align-self: stretch;
    align-items: flex-start;
    justify-content: center;
    padding: 0 0 7px;
  }

  .platform:nth-child(n + 5):nth-child(-n + 9) strong,
  .platform:nth-child(n + 14):nth-child(-n + 18) strong,
  .platform:nth-child(n + 19):nth-child(-n + 24) strong {
    font-size: 10px;
    text-align: left;
  }

  .platform-logo,
  .platform:nth-child(4n + 2) .platform-logo,
  .platform:nth-child(5n) .platform-logo {
    width: 32px;
    height: 32px;
    margin: 0;
  }

  .progress {
    left: 45px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-particles i {
    animation: none;
  }
}

.cursor-glow {
  display: none;
}

@media (pointer: fine) {
  .cursor-glow {
    position: fixed;
    z-index: 999;
    display: block;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(147, 241, 83, .15) 0, rgba(91, 204, 73, .075) 34%, transparent 70%);
    mix-blend-mode: screen;
    transition: opacity .22s ease;
  }

  .cursor-glow.is-visible {
    opacity: 1;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: 35px;
  }

  .platform-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .platform {
    height: 74px;
  }

  .platform strong {
    font-size: 11px;
  }
}
