/* =====================================================
   APEX IP — sections/services.css
   "The Problem" — Private AI Infrastructure
   Left copy + right image · 3-card grid · orange CTA
   Base canvas: 1920px
   ===================================================== */

/* ---------- Section shell ---------- */
.apx-problem {
  width: 100%;
  max-width: var(--apx-canvas);
  margin: 0 auto;
  padding: 320px var(--apx-pad-x) 160px;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: 160px;
}

/* =====================================================
   TOP ROW — intro copy (left) + visual (right)
   ===================================================== */
.apx-problem-top {
  display: flex;
  align-items: center;   /* image vertically centred with the left column */
  gap: 80px;
}

/* Left col — 628 px at Figma canvas */
.apx-problem-intro {
  width: 628px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Badge ─ liquid-glass pill (mirrors navbar aesthetic) */
.apx-badge {
  display: inline-flex;
  align-self: flex-start;   /* hug content width, don't stretch */
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--apx-radius-pill);
  isolation: isolate;

  /* glass: transparent + blur */
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px) saturate(110%);
  -webkit-backdrop-filter: blur(4px) saturate(110%);

  /* rim highlights matching navbar */
  box-shadow:
    inset 0 1px 0   rgba(255, 255, 255, 0.12),
    inset 0 -1px 0  rgba(255, 255, 255, 0.40),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 2px 8px       rgba(0, 0, 0, 0.18);

  color: #F2F2F2;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Copy block */
.apx-problem-copy {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.apx-problem-title {
  color: #F2F2F2;
  font-size: 56px;
  font-weight: 500;
  line-height: 1.2;   /* Figma 120% */
}

.apx-problem-body {
  max-width: 577px;
  color: #F2F2F2;
  font-size: 18px;
  font-weight: 300;
  line-height: 27px;
}

/* Right col — flex:1, fills remaining space */
.apx-problem-visual {
  flex: 1;
  min-width: 0;
}

.apx-problem-visual img {
  width: 100%;
  height: 572px;
  object-fit: cover;
  border-radius: 24px;
  display: block;
}

/* =====================================================
   BOTTOM — 3 cards + CTA
   ===================================================== */
.apx-problem-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

/* Cards row */
.apx-problem-cards {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

/* Individual card */
.apx-card {
  flex: 1;
  padding: 40px;
  background: #0A0A0A;
  border-radius: 24px;
  border: 1px solid rgba(51, 51, 51, 0.40);
  display: flex;
  flex-direction: column;
  gap: 32px;

  transition: border-color 0.30s ease;
}

.apx-card:hover {
  border-color: rgba(229, 48, 11, 0.28);
}

.apx-card-icon {
  flex-shrink: 0;
  line-height: 0; /* collapse inline gap below SVG */
}

.apx-card-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apx-card-title {
  color: #F2F2F2;
  font-size: 28px;
  font-weight: 500;
}

.apx-card-text {
  color: #F2F2F2;
  font-size: 18px;
  font-weight: 300;
  line-height: 27px;
}

/* ---------- Primary CTA button (orange pill) ---------- */
.apx-btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: var(--apx-radius-pill);
  background: #CC2A0A;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #F2F2F2;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  isolation: isolate;

  box-shadow:
    inset 0 1px 0   rgba(255, 255, 255, 0.32),
    inset 0 -1px 0  rgba(0, 0, 0, 0.20),
    0 4px 9px       rgba(246, 84, 51, 0.40),
    0 1px 2px       rgba(0, 0, 0, 0.25);

  transition:
    transform  0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.30s cubic-bezier(0.4, 0, 0.2, 1),
    filter     0.25s ease;
}

.apx-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0   rgba(255, 255, 255, 0.38),
    inset 0 -1px 0  rgba(0, 0, 0, 0.22),
    0 5px 11px      rgba(246, 84, 51, 0.55),
    0 2px 4px       rgba(0, 0, 0, 0.30);
}

.apx-btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.18),
    inset 0 -1px 0  rgba(255, 255, 255, 0.10),
    0 2px 8px       rgba(246, 84, 51, 0.35);
}

/* Small variant — inline CTA below body copy (section 2) */
.apx-btn-primary--sm {
  font-size: 16px;
  padding: 10px 22px;
  gap: 6px;
  align-self: flex-start;   /* hug content width, don't stretch */
}

/* Arrow nudges right on hover */
.apx-btn-primary svg {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.apx-btn-primary:hover svg {
  transform: translateX(3px);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Laptop (≤ 1440px) */
@media (max-width: 1440px) {
  .apx-problem {
    padding-top: 160px;
    padding-bottom: 120px;
    gap: 120px;
  }

  .apx-problem-intro {
    width: 480px;
    gap: 56px;
  }

  .apx-problem-title {
    font-size: 48px;
  }

  .apx-problem-visual img {
    height: 460px;
  }
}

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .apx-problem {
    padding-top: 100px;
    padding-bottom: 80px;
    gap: 80px;
  }

  .apx-problem-top {
    flex-direction: column;
    gap: 48px;
  }

  .apx-problem-intro {
    width: 100%;
    gap: 40px;
  }

  .apx-problem-title {
    font-size: 40px;
  }

  .apx-problem-body {
    max-width: 100%;
    font-size: 17px;
  }

  .apx-problem-visual img {
    height: 380px;
  }

  .apx-card-title {
    font-size: 22px;
  }

  .apx-problem-bottom {
    gap: 56px;
  }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
  .apx-problem {
    padding-top: 72px;
    padding-bottom: 72px;
    gap: 64px;
  }

  .apx-problem-intro {
    gap: 28px;
  }

  .apx-problem-title {
    font-size: 30px;
    line-height: 1.18;
  }

  .apx-problem-body {
    font-size: 15px;
    max-width: 100%;
  }

  .apx-problem-visual img {
    height: 240px;
  }

  .apx-problem-cards {
    flex-direction: column;
  }

  .apx-card {
    padding: 28px;
    gap: 24px;
  }

  .apx-card-title {
    font-size: 22px;
  }

  .apx-card-text {
    font-size: 16px;
  }

  .apx-problem-bottom {
    gap: 48px;
  }

  .apx-btn-primary {
    font-size: 16px;
    padding: 11px 24px;
  }
}

/* =====================================================
   SECTION 3 — AI SYSTEMS
   "Private AI Systems" · full-width header · 3 glow cards · CTA
   ===================================================== */

/* ---------- Section shell ---------- */
.apx-ai-systems {
  width: 100%;
  max-width: var(--apx-canvas);
  margin: 0 auto;
  padding: 160px var(--apx-pad-x);
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

/* ---------- Header: badge + title + body ---------- */
.apx-ai-systems-header {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.apx-ai-systems-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.apx-ai-systems-title {
  color: #F2F2F2;
  font-size: 56px;
  font-weight: 500;
  line-height: 67.20px;
}

.apx-ai-systems-body {
  max-width: 628px;
  color: #F2F2F2;
  font-size: 18px;
  font-weight: 300;
  line-height: 27px;
}

/* ---------- Cards row ---------- */
.apx-ai-systems-cards {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

/* Glow variant: subtle red radial from the bottom */
.apx-card--glow {
  background:
    radial-gradient(
      ellipse 63.37% 63.37% at 50% 117.44%,
      rgba(229, 48, 11, 0.10) 0%,
      rgba(229, 48, 11, 0.00) 100%
    ),
    #0A0A0A;
  transition: none;           /* no hover border change */
}
.apx-card--glow:hover {
  border-color: rgba(51, 51, 51, 0.40);   /* keep border static */
}

/* =====================================================
   SECTION 2 — scroll-triggered cascade + image float
   JS adds .is-visible to .apx-problem
   ===================================================== */

/* Float — always running on the image (invisible until wrapper fades in) */
@keyframes apx-float {
  0%, 100% { transform: translateY(0px);   }
  50%       { transform: translateY(-10px); }
}

.apx-problem-visual img {
  animation: apx-float 6s ease-in-out infinite;
}

/* Reveal keyframe: fade up + gentle scale-in */
@keyframes apx-fade-scale {
  from { opacity: 0; transform: scale(1.04) translateY(14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* ── Initial hidden states ── */
.apx-problem .apx-badge,
.apx-problem-title,
.apx-problem-body,
.apx-problem-copy .apx-btn-primary,
.apx-problem-visual {
  opacity: 0;
  transform: translateY(20px);
}

/* ── Animate on .is-visible ── */
.apx-problem.is-visible .apx-badge,
.apx-problem.is-visible .apx-problem-title,
.apx-problem.is-visible .apx-problem-body,
.apx-problem.is-visible .apx-problem-copy .apx-btn-primary {
  animation: apx-fade-up 0.60s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.apx-problem.is-visible .apx-problem-visual {
  animation: apx-fade-scale 0.90s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Staggered delays ── */
.apx-problem.is-visible .apx-badge                          { animation-delay: 0.00s; }
.apx-problem.is-visible .apx-problem-title                  { animation-delay: 0.15s; }
.apx-problem.is-visible .apx-problem-body                   { animation-delay: 0.30s; }
.apx-problem.is-visible .apx-problem-copy .apx-btn-primary  { animation-delay: 0.50s; }
.apx-problem.is-visible .apx-problem-visual                 { animation-delay: 0.25s; }

/* =====================================================
   SECTION 3 — scroll-triggered cascade
   JS adds .is-visible to .apx-ai-systems when it enters
   the viewport; every child animates in sequence.
   ===================================================== */

@keyframes apx-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Initial hidden state (scoped to section 3 only) ── */
.apx-ai-systems .apx-badge,
.apx-ai-systems-title,
.apx-ai-systems-body,
.apx-ai-systems .apx-btn-primary,
.apx-ai-systems-cards .apx-card {
  opacity: 0;
  transform: translateY(24px);
}

/* ── Animate everything once .is-visible lands ── */
.apx-ai-systems.is-visible .apx-badge,
.apx-ai-systems.is-visible .apx-ai-systems-title,
.apx-ai-systems.is-visible .apx-ai-systems-body,
.apx-ai-systems.is-visible .apx-btn-primary,
.apx-ai-systems.is-visible .apx-ai-systems-cards .apx-card {
  animation: apx-fade-up 0.60s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Staggered delays ── */
.apx-ai-systems.is-visible .apx-badge                          { animation-delay: 0.00s; }
.apx-ai-systems.is-visible .apx-ai-systems-title               { animation-delay: 0.15s; }
.apx-ai-systems.is-visible .apx-ai-systems-body                { animation-delay: 0.30s; }
.apx-ai-systems.is-visible .apx-btn-primary                    { animation-delay: 0.50s; }
.apx-ai-systems.is-visible .apx-ai-systems-cards .apx-card:nth-child(1) { animation-delay: 0.70s; }
.apx-ai-systems.is-visible .apx-ai-systems-cards .apx-card:nth-child(2) { animation-delay: 0.90s; }
.apx-ai-systems.is-visible .apx-ai-systems-cards .apx-card:nth-child(3) { animation-delay: 1.10s; }

/* ── Responsive ─────────────────────────────────── */

/* Laptop (≤ 1440px) */
@media (max-width: 1440px) {
  .apx-ai-systems {
    padding-top: 120px;
    padding-bottom: 120px;
    gap: 64px;
  }

  .apx-ai-systems-title {
    font-size: 48px;
    line-height: 1.2;
  }
}

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .apx-ai-systems {
    padding-top: 80px;
    padding-bottom: 80px;
    gap: 56px;
  }

  .apx-ai-systems-header {
    gap: 48px;
  }

  .apx-ai-systems-title {
    font-size: 40px;
    line-height: 1.2;
  }

  .apx-ai-systems-body {
    max-width: 100%;
    font-size: 17px;
  }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
  .apx-ai-systems {
    padding-top: 64px;
    padding-bottom: 64px;
    gap: 48px;
  }

  .apx-ai-systems-header {
    gap: 28px;
  }

  .apx-ai-systems-title {
    font-size: 30px;
    line-height: 1.18;
  }

  .apx-ai-systems-body {
    font-size: 15px;
    max-width: 100%;
  }

  .apx-ai-systems-cards {
    flex-direction: column;
  }
}
