/* ── Popup: Base ── */
.popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.popup.open {
  opacity: 1;
  visibility: visible;
}

/* ── Backdrop ── */
.popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 22, .8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Box: Glass morphism ── */
.popup__box {
  position: relative;
  background: linear-gradient(165deg, rgba(22, 29, 50, .92), rgba(14, 20, 37, .96));
  border: 1px solid rgba(60, 215, 255, .12);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 40px rgba(60, 215, 255, .06),
    0 24px 48px rgba(0, 0, 0, .4);
  transform: translateY(20px) scale(.97);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: none;
}

.popup__box::-webkit-scrollbar { display: none; }

.popup.open .popup__box {
  transform: translateY(0) scale(1);
}

/* ── Close button ── */
.popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.popup__close:hover {
  background: rgba(60, 215, 255, .1);
  border-color: rgba(60, 215, 255, .25);
  color: var(--tertiary);
}

/* ── Typography ── */
.popup__body h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 0.75rem;
}

.popup__body p {
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.popup__body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--tertiary);
  margin-bottom: 0.25rem;
}

.popup__body strong { color: var(--on-surface); }
.popup__body em { font-style: normal; color: var(--tertiary); font-weight: 600; }

/* ── Hero title ── */
.popup__hero-title {
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  text-align: center;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
}

.popup.open .popup__hero-title {
  animation: popupFadeUp .5s cubic-bezier(.22, 1, .36, 1) .15s forwards;
}

/* ── Gradient title (solutions popup) ── */
.popup__gradient-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
  background: linear-gradient(135deg, var(--tertiary), var(--primary-container));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Animated divider ── */
.popup__divider {
  height: 1px;
  margin: 1rem 0;
  background: linear-gradient(90deg, transparent, var(--tertiary), var(--primary-container), var(--tertiary), transparent);
  background-size: 300% 100%;
  opacity: 0;
  transform: scaleX(0);
}

.popup.open .popup__divider {
  animation: popupDividerIn .6s cubic-bezier(.22, 1, .36, 1) .25s forwards,
             divider-sweep 4s ease 1s infinite;
}

/* ── Intro text ── */
.popup__body > p {
  opacity: 0;
  transform: translateY(8px);
}

.popup.open .popup__body > p {
  animation: popupFadeUp .5s cubic-bezier(.22, 1, .36, 1) .3s forwards;
}

/* ── Cards: staggered reveal ── */
.popup__cards {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.popup__card {
  flex: 1;
  background: linear-gradient(145deg, rgba(14, 20, 37, .9), rgba(28, 37, 61, .6));
  border: 1px solid rgba(60, 215, 255, .12);
  border-radius: 8px;
  padding: 1.5rem 1.25rem 1.25rem;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: border-color .3s, box-shadow .3s, transform .3s;
  text-align: center;
}

.popup__card:hover {
  border-color: rgba(60, 215, 255, .35);
  box-shadow: 0 8px 30px rgba(60, 215, 255, .12), inset 0 1px 0 rgba(60, 215, 255, .1);
  transform: translateY(-4px);
}

.popup.open .popup__card:nth-child(1) {
  animation: popupSlideIn .5s cubic-bezier(.22, 1, .36, 1) .35s forwards;
}

.popup.open .popup__card:nth-child(2) {
  animation: popupSlideIn .5s cubic-bezier(.22, 1, .36, 1) .5s forwards;
}

.popup__card-icon {
  position: static;
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 6px rgba(60, 215, 255, .4));
}

.popup__card-img {
  width: 60px;
  height: auto;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.popup__card h4 {
  margin-bottom: 0.5rem;
  color: var(--tertiary);
  font-size: 1rem;
}

.popup__card p {
  margin-bottom: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.popup__card p em {
  font-style: normal;
  color: var(--tertiary);
  font-weight: 600;
}

.popup__card p strong {
  color: var(--primary);
}

@media (max-width: 480px) {
  .popup__cards { flex-direction: column; }
}

/* ── Logo section ── */
.popup__logo-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0;
  opacity: 0;
  transform: translateY(8px);
}

.popup.open .popup__logo-section {
  animation: popupFadeUp .5s cubic-bezier(.22, 1, .36, 1) .6s forwards;
}

.popup__logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  filter: drop-shadow(0 0 12px rgba(60, 215, 255, .15));
  cursor: pointer;
  transition: transform .2s, filter .2s;
}

.popup__logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 18px rgba(60, 215, 255, .3));
}

/* ── Logo Lightbox ── */
.popup__lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 22, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity .3s ease, visibility .3s ease;
}

.popup__lightbox.open {
  opacity: 1;
  visibility: visible;
}

.popup__lightbox img {
  max-width: 70vmin;
  max-height: 70vmin;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(60, 215, 255, .15));
  transform: scale(.9);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

.popup__lightbox.open img {
  transform: scale(1);
}

.popup__logo-desc {
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ── Tagline ── */
.popup__tagline-intro {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  text-align: center;
  margin-bottom: 0;
  opacity: 0;
}

.popup.open .popup__tagline-intro {
  animation: popupFadeUp .5s cubic-bezier(.22, 1, .36, 1) .7s forwards;
}

.popup__tagline {
  font-family: 'Space Mono', monospace;
  font-size: 0.8125rem;
  color: var(--primary);
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
  font-weight: 700;
  opacity: 0;
}

.popup.open .popup__tagline {
  animation: popupFadeUp .5s cubic-bezier(.22, 1, .36, 1) .8s forwards;
}

.popup__tagline em {
  font-style: normal;
  color: var(--tertiary);
}

/* ── Image (solutions) ── */
.popup__image {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 1rem;
  object-fit: cover;
  max-height: 240px;
}

/* ── Keyframes ── */
@keyframes popupFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popupSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popupDividerIn {
  to { opacity: .6; transform: scaleX(1); }
}

/* ── Mobile ≤ 480px ── */
@media (max-width: 480px) {
  .popup__box {
    width: 95%;
    padding: 2rem 1.25rem;
    max-height: 90vh;
    border-radius: 6px;
  }

  .popup__hero-title { font-size: 1.5rem; }

  .popup__logo-section {
    flex-direction: column;
    text-align: center;
  }

  .popup__logo {
    width: 180px;
    height: 180px;
  }
}

/* ── Video popup variant ── */
.popup__box--video {
  width: 90vw;
  max-width: 960px;
  padding: 1rem;
}
.popup__box--video .commercial__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
.popup__box--video .commercial__video iframe {
  width: 100%;
  height: 100%;
  border: none;
}
