/* =========================
   HERO WITH GRADIENT
========================= */

.nx-hero {
  min-height: 500px;
  padding: 5rem 0 4rem;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, 
    rgba(5, 5, 8, 1) 0%, 
    rgba(20, 20, 33, 0.95) 50%,
    rgba(12, 12, 18, 0.9) 100%);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nx-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 77, 90, 0.12) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 60%, rgba(255, 159, 60, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(147, 51, 234, 0.06) 0%, transparent 60%);
  pointer-events: none;
  animation: gradientFloat 20s ease-in-out infinite;
}

@keyframes gradientFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-5%, 5%) rotate(1deg); }
  66% { transform: translate(5%, -3%) rotate(-1deg); }
}

.nx-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

/* Left content */
.nx-hero-left h1 {
  font-size: var(--nx-font-size-xxl);
  line-height: 1.05;
  margin-bottom: var(--nx-space-4);
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nx-hero-left p {
  max-width: 34rem;
}

.nx-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-3);
  margin-top: var(--nx-space-4);
}

.nx-hero-meta {
  margin-top: var(--nx-space-3);
  font-size: var(--nx-font-size-sm);
  color: var(--nx-color-muted);
}

/* Right: logo image */
.nx-hero-right {
  display: flex;
  justify-content: center;
  position: relative;
}

.nx-hero-right::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(255, 77, 90, 0.15) 0%, transparent 70%);
  filter: blur(60px);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

.nx-hero-logo {
  max-width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45),
              0 0 80px rgba(255, 77, 90, 0.2);
  position: relative;
  z-index: 1;
}

/* =========================
   SECTION SEPARATORS
========================= */

.nx-section-separator {
  position: relative;
  height: 1px;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 0, 0, 0.18),
    transparent
  );
  opacity: 1;
}

/* Only animate when JS is enabled */
.animations-enabled .nx-section-separator {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.nx-section-separator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.25;
}

/* Provide breathing room around sections */
.nx-section {
  padding: 4rem 0;
  position: relative;
  opacity: 1;
  transform: translateY(0);
}

/* Only apply animation states when JS is ready */
.animations-enabled .nx-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Animation triggers when section is visible */
.animations-enabled .nx-section.animated {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   DYNAMIC GRADIENT SECTIONS
========================= */

/* Alternating gradient backgrounds with depth */
.nx-light {
  background: 
    linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f1f5f9 100%);
  position: relative;
  color: #111827;
  overflow: hidden;
}

.nx-light::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  background: 
    radial-gradient(circle at 25% 35%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 75% 65%, rgba(139, 92, 246, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 90%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: gradientShift 25s ease-in-out infinite;
}

.nx-light::after {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 100px,
      rgba(99, 102, 241, 0.02) 100px,
      rgba(99, 102, 241, 0.02) 200px
    );
  pointer-events: none;
  z-index: 0;
}

@keyframes gradientShift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-3%, 4%) scale(1.02); }
  66% { transform: translate(4%, -2%) scale(0.98); }
}

.nx-light > * {
  position: relative;
  z-index: 1;
}

.nx-light-alt {
  background: 
    linear-gradient(170deg, #ffffff 0%, #fef3f2 35%, #fefce8 70%, #ffffff 100%);
  position: relative;
  color: #111827;
  overflow: hidden;
}

.nx-light-alt::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 140%;
  height: 180%;
  background: 
    radial-gradient(ellipse at 70% 25%, rgba(255, 77, 90, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 75%, rgba(255, 159, 60, 0.05) 0%, transparent 55%),
    radial-gradient(circle at 85% 50%, rgba(251, 146, 60, 0.04) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
  animation: gradientFloat 30s ease-in-out infinite;
}

.nx-light-alt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 150px,
      rgba(255, 77, 90, 0.015) 150px,
      rgba(255, 77, 90, 0.015) 300px
    );
  pointer-events: none;
  z-index: 0;
}

.nx-light-alt > * {
  position: relative;
  z-index: 1;
}

/* Section headers */
.nx-section-header {
  max-width: 40rem;
}

.nx-section-header h2 {
  font-size: var(--nx-font-size-xl);
  margin-bottom: var(--nx-space-3);
}

.nx-section-header p {
  margin: 0;
}

/* Stronger headings in light sections */
.nx-light h2,
.nx-light-alt h2,
.nx-light h3,
.nx-light-alt h3 {
  color: #020617;
}

/* Add subtle text gradient to h2 in light sections */
.nx-light h2 {
  background: linear-gradient(135deg, #1e293b 0%, #3730a3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nx-light-alt h2 {
  background: linear-gradient(135deg, #1e293b 0%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================
   ENHANCED CARDS WITH GLASS EFFECT
========================= */

.nx-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.75rem 1.9rem;
  border-radius: 16px;
  box-shadow: 
    0 10px 30px rgba(15, 23, 42, 0.08),
    0 2px 8px rgba(99, 102, 241, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  position: relative;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease-out,
    border-color 0.3s ease-out,
    background 0.3s ease-out;
}

/* Only apply animation states when JS is ready */
.animations-enabled .nx-card {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition:
    transform 0.6s ease-out,
    box-shadow 0.3s ease-out,
    border-color 0.3s ease-out,
    background 0.3s ease-out,
    opacity 0.6s ease-out;
}

/* Trigger animation when card is visible */
.animations-enabled .nx-card.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Staggered delay for multiple cards */
.animations-enabled .nx-card:nth-child(1) { transition-delay: 0s; }
.animations-enabled .nx-card:nth-child(2) { transition-delay: 0.1s; }
.animations-enabled .nx-card:nth-child(3) { transition-delay: 0.2s; }
.animations-enabled .nx-card:nth-child(4) { transition-delay: 0.3s; }
.animations-enabled .nx-card:nth-child(5) { transition-delay: 0.4s; }
.animations-enabled .nx-card:nth-child(6) { transition-delay: 0.5s; }

.nx-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.2) 0%, 
    rgba(139, 92, 246, 0.1) 50%,
    rgba(59, 130, 246, 0.15) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.nx-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 
    0 20px 50px rgba(15, 23, 42, 0.15),
    0 8px 20px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(255, 255, 255, 0.92) 100%);
}

.nx-card:hover::before {
  opacity: 1;
}

/* Cards in light-alt sections get warm accent */
.nx-light-alt .nx-card::before {
  background: linear-gradient(135deg, 
    rgba(255, 77, 90, 0.2) 0%, 
    rgba(255, 159, 60, 0.15) 100%);
}

/* Text-only block */
.nx-text-block p:last-child {
  margin-bottom: 0;
}

/* =========================
   SERVICES GRID ("Where our design lives")
========================= */

.nx-worlds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.nx-world-card h3 {
  margin-bottom: var(--nx-space-2);
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nx-world-card:hover h3 {
  background: linear-gradient(135deg, #1e293b 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================
   PROCESS STEPS WITH ENHANCED STYLING
========================= */

.nx-process-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.nx-process-steps .nx-card span {
  display: inline-block;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--nx-space-2);
  line-height: 1;
}

.nx-process-steps .nx-card h4 {
  margin-bottom: var(--nx-space-2);
  font-size: var(--nx-font-size-lg);
}

/* =========================
   INTRO SECTION STYLING
========================= */

.nx-intro {
  text-align: center;
}

.nx-intro h2 {
  font-size: 2.25rem;
  margin-bottom: var(--nx-space-4);
}

.nx-section-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 48rem;
  margin: 0 auto;
  color: #475569;
}

/* =========================
   PHILOSOPHY & TRUST SECTIONS
========================= */

.nx-philosophy {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 2rem;
}

.nx-philosophy h2 {
  margin-bottom: var(--nx-space-6);
  font-size: 2rem;
}

.nx-philosophy p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #334155;
}

.nx-trust {
  max-width: 52rem;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 2rem;
}

.nx-trust p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #334155;
  margin: 0;
}

/* =========================
   CTA SECTION
========================= */

.nx-cta-inner {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 42rem;
  margin: 0 auto;
}

.nx-cta-inner h2 {
  margin-bottom: var(--nx-space-6);
  font-size: 2rem;
}

.nx-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  border-radius: var(--nx-radius-pill);
  background: linear-gradient(135deg, var(--nx-color-primary) 0%, var(--nx-color-primary-soft) 100%);
  color: #ffffff;
  font-size: var(--nx-font-size-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 
    0 10px 30px rgba(255, 77, 90, 0.3),
    0 4px 12px rgba(255, 159, 60, 0.2);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.nx-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 15px 40px rgba(255, 77, 90, 0.4),
    0 8px 20px rgba(255, 159, 60, 0.3);
}



/* =========================
   COMPANIES SHOWCASE ANIMATIONS
========================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =========================
   COMPANIES SHOWCASE SECTION
========================= */

.companies-showcase {
  background: linear-gradient(180deg,
    #0b1120 0%,
    #020617 100%);
  position: relative;
  overflow: hidden;
  padding: 0;
  animation: fadeIn 0.6s ease-out;
}

/* Gradient overlay for depth */
.companies-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.35) 0%,
    rgba(2, 6, 23, 0.85) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.companies-showcase::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 150%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 77, 90, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(147, 51, 234, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.companies-showcase-inner {
  padding: 4rem 0 3rem;
  position: relative;
  z-index: 1;
}

.companies-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.company-card {
  background: linear-gradient(135deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(15, 23, 42, 0.90) 100%);
  border: 1px solid rgba(15, 23, 42, 1);
  border-radius: 16px;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out;
  animation: fadeInUp 0.8s ease-out backwards;
}

.company-card:first-child {
  animation-delay: 0.2s;
}

.company-card:last-child {
  animation-delay: 0.4s;
}

.company-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(255, 77, 90, 0.3) 0%,
    rgba(255, 159, 60, 0.2) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.company-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 77, 90, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.company-card:hover::before {
  opacity: 1;
}

.company-card.labs::before {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.3) 0%, 
    rgba(147, 51, 234, 0.2) 100%);
}

.company-card.labs:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

/* Logo - displayed by default */
.company-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  position: relative;
  z-index: 2;
}

.company-card:hover .company-logo {
  opacity: 0;
  transform: scale(0.9);
}

/* Content overlay - hidden by default */
.company-content {
  position: absolute;
  inset: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  z-index: 3;
}

.company-card:hover .company-content {
  opacity: 1;
  transform: translateY(0);
}

.company-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.company-card.labs h3 {
  background: linear-gradient(135deg, #ffffff 0%, #ddd6fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.company-tagline {
  font-size: 0.95rem;
  color: #94a3b8;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.company-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, 
    rgba(255, 77, 90, 0.15) 0%, 
    rgba(255, 159, 60, 0.1) 100%);
  border: 1px solid rgba(255, 77, 90, 0.3);
  border-radius: 999px;
  color: #fef2f2;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease-out;
}

.company-cta:hover {
  background: linear-gradient(135deg, 
    rgba(255, 77, 90, 0.25) 0%, 
    rgba(255, 159, 60, 0.2) 100%);
  border-color: rgba(255, 77, 90, 0.5);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(255, 77, 90, 0.3);
}

.company-card.labs .company-cta {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15) 0%, 
    rgba(147, 51, 234, 0.1) 100%);
  border-color: rgba(99, 102, 241, 0.3);
  color: #e0e7ff;
}

.company-card.labs .company-cta:hover {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.25) 0%, 
    rgba(147, 51, 234, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.company-cta::after {
  content: "→";
  font-size: 1.1rem;
  transition: transform 0.3s ease-out;
}

.company-cta:hover::after {
  transform: translateX(4px);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 980px) {
  .companies-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .companies-showcase-inner {
    padding: 3rem 0 2rem;
  }

  .company-card {
    padding: 2rem 1.5rem;
    min-height: 240px;
  }
    .nx-hero {
    padding-top: 4rem;
  }

  .nx-section {
    padding: 3rem 0;
  }

  .nx-intro h2,
  .nx-philosophy h2,
  .nx-cta-inner h2 {
    font-size: 1.75rem;
  }
}


@media (max-width: 900px) {
  .nx-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .nx-hero-left h1 {
    font-size: var(--nx-font-size-xl);
  }

  .nx-hero-left p,
  .nx-hero-meta,
  .nx-section-header {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  .nx-hero-actions {
    justify-content: center;
  }

  .nx-hero-right {
    margin-top: 2.5rem;
  }

  .nx-worlds-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .nx-process-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 768px) {
  .nx-hero {
    min-height: 400px;
    padding: 4rem 0 3rem;
  }
}
