/* Homepage defense network: 3D threat globe and autonomous-defense hero. */
.home-name-container {
  --hero-line-height: 40px;
  top: 22%;
  left: 50%;
  width: min(760px, calc(100vw - 48px));
  height: auto;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.72);
}

.home-hero-rotator {
  position: relative;
  display: block;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  height: var(--hero-line-height);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(20px, 2.15vw, 32px);
  font-weight: 300;
  line-height: var(--hero-line-height);
  letter-spacing: 0.05em;
  color: #d9d2c9;
  white-space: nowrap;
}

.home-hero-measure,
.home-hero-live {
  display: flex;
  align-items: center;
  gap: inherit;
}

.home-hero-measure {
  visibility: hidden;
}

.home-hero-live {
  position: absolute;
  inset: 0 auto auto 0;
}

.home-hero-rotator .home-name-static {
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.home-hero-rotator .home-name-wheel-wrap {
  display: block;
  height: var(--hero-line-height);
  width: max-content;
  min-width: 0;
  overflow: hidden;
  text-align: left;
}

.home-hero-rotator .home-name-wheel {
  display: flex;
  flex-direction: column;
  animation: defense-name-wheel 10.5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.home-hero-rotator .home-name-wheel > span {
  display: block;
  height: var(--hero-line-height);
  font: inherit;
  line-height: var(--hero-line-height);
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
}

@keyframes defense-name-wheel {
  0%, 22% { transform: translateY(0); }
  29%, 51% { transform: translateY(calc(var(--hero-line-height) * -1)); }
  58%, 80% { transform: translateY(calc(var(--hero-line-height) * -2)); }
  87%, 100% { transform: translateY(calc(var(--hero-line-height) * -3)); }
}

.home-name-container p {
  max-width: 590px;
  margin-top: 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(9px, 0.8vw, 12px);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.07em;
  text-align: center;
  text-transform: uppercase;
  color: rgba(244, 238, 230, 0.66);
}

.home-hero-link {
  pointer-events: auto;
  width: fit-content;
  margin-top: 18px;
  padding: 12px 0 10px;
  border-bottom: 1px solid rgba(244, 238, 230, 0.54);
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #f4eee6;
  transition: border-color 180ms ease, color 180ms ease;
}

.home-hero-link span {
  display: inline-block;
  margin-left: 9px;
  color: #d11919;
}

.home-hero-link:hover,
.home-hero-link:focus-visible {
  color: #fff;
  border-color: #d11919;
}

.threat-map-viewport {
  position: relative;
  overflow: hidden;
  background: #020303;
}

#defense-globe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  transition: opacity 700ms ease;
}

#defense-globe:active {
  cursor: grabbing;
}

@media (pointer: coarse) {
  #defense-globe,
  #defense-globe .cesium-viewer,
  #defense-globe .cesium-widget,
  #defense-globe canvas {
    touch-action: pan-y !important;
  }

  #defense-globe.globe-multitouch-active,
  #defense-globe.globe-multitouch-active .cesium-viewer,
  #defense-globe.globe-multitouch-active .cesium-widget,
  #defense-globe.globe-multitouch-active canvas {
    touch-action: none !important;
  }
}

.globe-ready #defense-globe {
  opacity: 1;
}

.globe-ready .threat-map-svg {
  display: none;
}

#defense-globe .cesium-viewer,
#defense-globe .cesium-viewer-cesiumWidgetContainer,
#defense-globe .cesium-widget,
#defense-globe canvas {
  width: 100%;
  height: 100%;
}

#defense-globe .cesium-widget-credits {
  right: 14px;
  bottom: 10px;
  opacity: 0.38;
  transform: scale(0.76);
  transform-origin: right bottom;
}

.globe-controls {
  position: absolute;
  z-index: 7;
  top: clamp(60px, 8vw, 118px);
  right: clamp(20px, 4vw, 66px);
  width: min(310px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid rgba(217, 210, 201, 0.22);
  background: rgba(2, 3, 3, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.36);
}

.globe-controls-label {
  display: block;
  font-family: 'Roboto Mono', monospace;
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.14em;
  color: #8d8780;
}

.globe-domain-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid rgba(217, 210, 201, 0.2);
}

.globe-domain-switch button {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid rgba(217, 210, 201, 0.16);
  background: transparent;
  font-family: 'Roboto Mono', monospace;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(217, 210, 201, 0.58);
  cursor: pointer;
}

.globe-domain-switch button:last-child {
  border-right: 0;
}

.globe-domain-switch button[aria-pressed='true'] {
  background: #d9d2c9;
  color: #050505;
}

.globe-domain-switch button:focus-visible {
  outline: 1px solid #d11919;
  outline-offset: -2px;
}

.globe-readout {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(217, 210, 201, 0.16);
}

.globe-readout strong {
  display: block;
  font-family: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #f4eee6;
}

.threat-map-message {
  max-width: min(660px, calc(100vw - 420px));
}

.threat-map-message strong {
  font-size: clamp(56px, 7vw, 112px);
}

.threat-map-message span {
  max-width: 580px;
}

@media (max-width: 900px) {
  .home-name-container {
    --hero-line-height: 34px;
    top: 18%;
    left: 50%;
    width: calc(100vw - 40px);
    transform: translateX(-50%);
  }

  .home-hero-rotator {
    gap: 9px;
    font-size: clamp(17px, 5vw, 23px);
  }

  .home-name-container p {
    max-width: 460px;
    margin-top: 12px;
    font-size: 9px;
    line-height: 1.55;
  }

  .home-hero-link {
    margin-top: 14px;
  }

  .globe-controls {
    top: 56px;
    right: 16px;
    width: 240px;
    padding: 14px;
  }

  .globe-readout {
    margin-top: 14px;
    padding-top: 14px;
  }

  .globe-readout strong {
    font-size: 26px;
  }

  .threat-map-message {
    left: 18px;
    bottom: 18px;
    width: calc(100vw - 36px);
    max-width: 500px;
  }

  .threat-map-message strong {
    max-width: 390px;
    font-size: clamp(44px, 14vw, 68px);
  }

  .threat-map-message span {
    max-width: min(390px, calc(100vw - 36px));
    font-size: 9px;
  }
}

@media (max-width: 540px) {
  .home-name-container {
    --hero-line-height: 30px;
    top: 16%;
  }

  .home-name-container p {
    max-width: 340px;
  }

  .globe-controls {
    top: 54px;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 12px;
  }

  .globe-readout {
    margin-top: 12px;
    padding-top: 12px;
  }

  .globe-readout strong {
    font-size: 23px;
  }

  .threat-map-message {
    bottom: 16px;
  }

  .threat-map-message strong {
    font-size: clamp(38px, 12vw, 54px);
  }

  .threat-map-message span {
    margin-top: 10px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  #defense-globe,
  .home-hero-link {
    transition: none;
  }

  .home-hero-rotator .home-name-wheel {
    animation: none;
  }
}
