/* ======== TECHNOLOGY ======== */
/* Simplified Technology Section - Tandem Intelligence Suite Only */

/* No container override - uses default site container width */

/* ========================================
   INTELLIGENCE SUITE CONTAINER
   ======================================== */
.intelligence-suite {
  position: relative;
  width: 100%;
}

.intelligence-suite__wrapper {
  position: relative;
  padding: var(--space-12);
  background: linear-gradient(
    135deg,
    rgba(254, 0, 0, 0.06) 0%,
    rgba(254, 0, 0, 0.02) 100%
  );
  border: 2px solid rgba(254, 0, 0, 0.3);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 0 80px rgba(254, 0, 0, 0.12),
    0 0 160px rgba(254, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Red glow effect behind the container */
.intelligence-suite__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110%;
  height: 130%;
  background: radial-gradient(
    ellipse at center,
    rgba(254, 0, 0, 0.12) 0%,
    transparent 60%
  );
  z-index: -1;
  pointer-events: none;
  animation: pulseGlow 5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .intelligence-suite__glow {
    animation: none;
    opacity: 0.8;
  }

  .tandem-tool__inner {
    transition: none;
  }
}

/* ========================================
   SUITE HEADER
   ======================================== */
.suite-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.suite-header__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-3);
}

.suite-header__tagline {
  font-size: 1rem;
  color: var(--white-70);
  max-width: 600px;
  margin: 0 auto;
  text-wrap: balance;
}

/* ========================================
   TOOLS GRID - 5x2 LAYOUT
   ======================================== */
.tandem-tools {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
}

/* ========================================
   FLIP CARD - TOOL COMPONENT
   Cross-browser compatible (Chrome, Firefox, Safari)
   ======================================== */
.tandem-tool {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  height: 160px;
  cursor: pointer;
  /* Prevent z-index bleed in Firefox */
  isolation: isolate;
}

.tandem-tool__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  /* Explicit initial transform for Firefox */
  transform: rotateY(0deg);
}

.tandem-tool:hover .tandem-tool__inner,
.tandem-tool:focus-within .tandem-tool__inner,
.tandem-tool.is-flipped .tandem-tool__inner {
  transform: rotateY(180deg);
}

/* Front and Back faces - bulletproof cross-browser setup */
.tandem-tool__front,
.tandem-tool__back {
  position: absolute;
  width: 100%;
  height: 100%;
  /* Backface visibility - order matters for Firefox */
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  backface-visibility: hidden;
  /* CRITICAL: flat transform-style on faces fixes Firefox bleed-through */
  -webkit-transform-style: flat;
  -moz-transform-style: flat;
  transform-style: flat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-3);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-lg);
  text-align: center;
  /* Solid background - required for proper occlusion */
  background-color: #1c1c1e;
  /* Prevent content overflow from breaking 3D */
  overflow: hidden;
}

.tandem-tool__front {
  z-index: 2;
  transform: rotateY(0deg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%), #1c1c1e;
  /* Transition for visibility toggle */
  transition: visibility 0s linear 0s;
}

/* Firefox fix: use visibility + opacity for bulletproof hiding */
.tandem-tool:hover .tandem-tool__front,
.tandem-tool:focus-within .tandem-tool__front,
.tandem-tool.is-flipped .tandem-tool__front {
  /* Hide after flip completes - prevents any bleed-through */
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

.tandem-tool__back {
  z-index: 1;
  transform: rotateY(180deg);
  background: linear-gradient(
    135deg,
    rgba(254, 0, 0, 0.25) 0%,
    rgba(254, 0, 0, 0.12) 100%
  ), #1c1c1e;
  border-color: rgba(254, 0, 0, 0.5);
  padding: var(--space-3);
  /* Start hidden, show when flipped */
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

/* Show back face when flipped */
.tandem-tool:hover .tandem-tool__back,
.tandem-tool:focus-within .tandem-tool__back,
.tandem-tool.is-flipped .tandem-tool__back {
  visibility: visible;
  transition: visibility 0s linear 0s;
}

/* Content opacity transitions for smooth appearance */
.tandem-tool__front > * {
  transition: opacity 0.15s ease-out;
}

.tandem-tool:hover .tandem-tool__front > *,
.tandem-tool:focus-within .tandem-tool__front > *,
.tandem-tool.is-flipped .tandem-tool__front > * {
  opacity: 0;
}

.tandem-tool__back > * {
  opacity: 0;
  transition: opacity 0.15s ease-out 0.15s;
}

.tandem-tool:hover .tandem-tool__back > *,
.tandem-tool:focus-within .tandem-tool__back > *,
.tandem-tool.is-flipped .tandem-tool__back > * {
  opacity: 1;
}

/* Icon */
.tandem-tool__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  margin-bottom: var(--space-2);
  color: var(--red-accent);
  transition: color var(--transition-fast);
}

.tandem-tool__icon svg {
  display: block;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  stroke: currentColor;
  fill: none;
}

.tandem-tool:hover .tandem-tool__icon {
  color: var(--white);
}

/* Front: Category (HEADLINE) + Name (SUBHEAD) */
.tandem-tool__category {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.tandem-tool__name {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--white-50);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Back: Value proposition */
.tandem-tool__value {
  font-size: 0.75rem;
  color: var(--white-90);
  line-height: 1.5;
}

/* Focus styles for accessibility */
.tandem-tool:focus {
  outline: none;
}

.tandem-tool:focus-visible .tandem-tool__front,
.tandem-tool:focus-visible .tandem-tool__back {
  outline: 2px solid var(--red-accent);
  outline-offset: 2px;
}

/* ========================================
   SUITE FOOTER
   ======================================== */
.suite-footer {
  text-align: center;
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--white-10);
}

.suite-footer__message {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--white-75);
  letter-spacing: 0.01em;
}

.suite-footer__message strong {
  color: var(--white);
}

/* ========================================
   RESPONSIVE - TABLET (1024px)
   ======================================== */
@media (max-width: 1024px) {
  .tandem-tools {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }

  .tandem-tool {
    height: 150px;
  }

  .tandem-tool__icon {
    width: 28px;
    height: 28px;
  }

  .tandem-tool__icon svg {
    width: 20px;
    height: 20px;
  }

  .tandem-tool__category {
    font-size: 0.8125rem;
  }

  .tandem-tool__value {
    font-size: 0.6875rem;
  }

  .intelligence-suite__wrapper {
    padding: var(--space-8);
  }
}

/* ========================================
   RESPONSIVE - MOBILE LARGE (768px)
   ======================================== */
@media (max-width: 768px) {
  .tandem-tools {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .tandem-tool {
    height: 140px;
  }

  .tandem-tool__icon {
    width: 24px;
    height: 24px;
    margin-bottom: var(--space-1);
  }

  .tandem-tool__icon svg {
    width: 18px;
    height: 18px;
  }

  .tandem-tool__category {
    font-size: 0.75rem;
  }

  .tandem-tool__name {
    font-size: 0.625rem;
  }

  .tandem-tool__value {
    font-size: 0.625rem;
  }

  .intelligence-suite__wrapper {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

  .suite-header__tagline {
    font-size: 0.875rem;
  }

  .suite-footer__message {
    font-size: 1rem;
  }
}

/* ========================================
   RESPONSIVE - MOBILE SMALL (480px)
   ======================================== */
@media (max-width: 480px) {
  .tandem-tools {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .tandem-tool {
    height: 120px;
  }

  .tandem-tool__icon {
    width: 24px;
    height: 24px;
    margin-bottom: var(--space-1);
  }

  .tandem-tool__icon svg {
    width: 18px;
    height: 18px;
  }

  .tandem-tool__category {
    font-size: 0.8125rem;
  }

  .tandem-tool__value {
    font-size: 0.6875rem;
    padding: 0 var(--space-2);
  }

  .intelligence-suite__wrapper {
    padding: var(--space-4);
  }
}
