/* ===========================================================================
   AI Services platform showcase  (homepage, directly under the top hero)
   Prefix: .aix-   Behavior: js/ai-showcase.js

   Bridges two design systems:
     - bravuramarketing.com : navy #171c2d, cream #f1eee3, orange #e37239,
                              blue #209bd9, Montserrat
     - ai.bravuramarketing.com : oversized condensed uppercase display,
                              diamond bullets, blueprint linework, stat row,
                              pill CTAs with arrows
   The AI site is light-on-warm; this section inverts it to the parent site's
   navy so it reads as bravuramarketing.com while speaking the AI site's
   visual language. Navy also gives the section a hard edge against the tan
   hero above and the cream section below.
   ========================================================================= */

.aix {
  --aix-navy-0: #0b0f1a;
  --aix-navy-1: #141a2b;
  --aix-navy-2: #1b2440;
  --aix-cream: #f1eee3;
  --aix-blue: #209bd9;
  --aix-orange: #e37239;
  --aix-muted: rgba(241, 238, 227, .62);
  --aix-hair: rgba(241, 238, 227, .14);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 56px;
  padding: clamp(72px, 9vh, 120px) clamp(20px, 5vw, 72px) clamp(48px, 6vh, 80px);
  background:
    radial-gradient(120% 90% at 12% 0%, var(--aix-navy-2) 0%, transparent 55%),
    radial-gradient(100% 80% at 100% 100%, #12203a 0%, transparent 60%),
    linear-gradient(180deg, var(--aix-navy-0) 0%, var(--aix-navy-1) 52%, var(--aix-navy-0) 100%);
  color: var(--aix-cream);
  font-family: Montserrat, sans-serif;
}

/* ---------- background layers ---------- */
.aix-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.aix-glow {
  position: absolute;
  width: 60vw; height: 60vw;
  max-width: 820px; max-height: 820px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .30;
  will-change: transform;
}
.aix-glow--blue   { top: -18%; left: -12%; background: radial-gradient(circle, var(--aix-blue) 0%, transparent 68%); animation: aix-drift-a 22s ease-in-out infinite; }
.aix-glow--orange { bottom: -24%; right: -14%; background: radial-gradient(circle, var(--aix-orange) 0%, transparent 68%); opacity: .22; animation: aix-drift-b 27s ease-in-out infinite; }

@keyframes aix-drift-a { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6%, 5%, 0) scale(1.10); } }
@keyframes aix-drift-b { 0%,100% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(-7%, -4%, 0) scale(.95); } }

/* blueprint linework, drawn on entry — the AI site's circuit motif */
.aix-circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.aix-circuit path {
  fill: none;
  stroke: var(--aix-blue);
  stroke-width: 1;
  opacity: .30;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
}
.aix.is-in .aix-circuit path { animation: aix-draw 2.4s cubic-bezier(.4,0,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes aix-draw { to { stroke-dashoffset: 0; } }

.aix-circuit rect.aix-node {
  fill: var(--aix-blue);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.aix.is-in .aix-circuit rect.aix-node { animation: aix-node-in .6s ease forwards, aix-pulse 3.4s ease-in-out infinite; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s); }
@keyframes aix-node-in { to { opacity: .85; } }
@keyframes aix-pulse   { 0%,100% { opacity: .85; } 50% { opacity: .25; } }

/* fine grain so the flat navy does not band on large screens */
.aix-grain {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.aix-inner {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

/* ---------- copy column ---------- */
.aix-eyebrow {
  /* flex-start, not center: when this wraps to two lines on narrow screens,
     centering would float the diamond down beside the second line */
  display: inline-flex; align-items: flex-start; gap: 10px;
  margin: 0 0 22px;
  font-size: clamp(10px, 1.05vw, 12px);
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--aix-blue);
}
.aix-dia {
  width: 7px; height: 7px; flex: none;
  margin-top: .5em;                 /* sits on the first line's optical centre */
  background: var(--aix-orange);
  transform: rotate(45deg);
}

.aix-title {
  margin: 0 0 24px;
  font-family: Montserrat, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 6.1vw, 5.6rem);
  line-height: .93;
  letter-spacing: -.02em;
  color: var(--aix-cream);
}
.aix-title .aix-line { display: block; }
.aix-title em {
  font-style: normal;
  color: var(--aix-blue);
  /* the AI site sets its final word in blue; echoed here */
}

.aix-lede {
  margin: 0 0 34px;
  max-width: 40ch;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.62;
  color: var(--aix-muted);
}
.aix-lede strong { color: var(--aix-cream); font-weight: 600; }

/* ---------- buttons ---------- */
.aix-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.aix-btn {
  /* the shared stylesheet sets a global `a { display:block; margin:20px 0 }` */
  display: inline-flex !important;
  align-items: center; gap: 10px;
  margin: 0 !important;
  padding: 16px 30px;
  border-radius: 999px;
  font-size: clamp(12px, 1.1vw, 13.5px);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease, color .22s ease;
}
.aix-btn .aix-arrow { transition: transform .22s ease; }
.aix-btn:hover .aix-arrow { transform: translateX(5px); }
.aix-btn:focus-visible { outline: 2px solid var(--aix-blue); outline-offset: 3px; }

.aix-btn--primary {
  position: relative; overflow: hidden;
  background: var(--aix-orange);
  color: #16110d;
  box-shadow: 0 12px 30px rgba(227, 114, 57, .30);
}
.aix-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(227, 114, 57, .42); color: #16110d; }
/* slow shimmer sweep to pull the eye to the primary action */
.aix-btn--primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
  animation: aix-sheen 4.6s ease-in-out infinite;
}
@keyframes aix-sheen { 0%, 62% { left: -120%; } 88%, 100% { left: 130%; } }

.aix-btn--ghost {
  background: transparent;
  color: var(--aix-cream);
  border: 1px solid var(--aix-hair);
}
.aix-btn--ghost:hover { transform: translateY(-2px); border-color: var(--aix-blue); background: rgba(32,155,217,.10); color: var(--aix-cream); }

/* ---------- pillar cards ---------- */
.aix-pillars {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.aix-card {
  position: relative;
  padding: 20px 18px 18px;
  border: 1px solid var(--aix-hair);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(241,238,227,.055), rgba(241,238,227,.015));
  backdrop-filter: blur(2px);
  transition: transform .26s ease, border-color .26s ease, background-color .26s ease;
}
.aix-card:hover { transform: translateY(-4px); border-color: rgba(32,155,217,.55); }
.aix-card::before {
  content: ""; position: absolute; left: 18px; top: 21px;
  width: 6px; height: 6px; background: var(--aix-blue); transform: rotate(45deg);
  transition: background-color .26s ease;
}
.aix-card:hover::before { background: var(--aix-orange); }
.aix-card-n {
  display: block; margin: 0 0 6px 16px;
  font-size: 10px; font-weight: 700; letter-spacing: .2em; color: var(--aix-blue);
}
.aix-card-t {
  display: block; margin: 0 0 6px;
  font-size: clamp(14px, 1.2vw, 15.5px); font-weight: 700; line-height: 1.25; color: var(--aix-cream);
}
.aix-card-d { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--aix-muted); }

/* ---------- stat row (mirrors the AI site's hero stat strip) ---------- */
.aix-stats {
  position: relative;
  width: 100%; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 40px);
  padding-top: 30px;
  border-top: 1px solid var(--aix-hair);
}
.aix-stat { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.aix-stat-n {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 900; line-height: 1;
  letter-spacing: -.02em; color: var(--aix-blue);
}
.aix-stat-l {
  font-size: clamp(10px, 1vw, 11.5px); font-weight: 600; letter-spacing: .17em;
  text-transform: uppercase; color: var(--aix-muted);
}

/* ---------- scroll reveal ---------- */
.aix-reveal { opacity: 0; transform: translateY(26px); }
.aix.is-in .aix-reveal {
  opacity: 1; transform: none;
  transition: opacity .72s cubic-bezier(.22,.61,.36,1) var(--d, 0s),
              transform .72s cubic-bezier(.22,.61,.36,1) var(--d, 0s);
}

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .aix { min-height: 0; gap: 44px; padding-top: 72px; padding-bottom: 60px; }
  .aix-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .aix-lede { max-width: none; }
  .aix-stats { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 24px; }
  .aix-stat { gap: 10px; }
}
@media (max-width: 560px) {
  .aix-pillars { grid-template-columns: minmax(0, 1fr); }
  .aix-actions { flex-direction: column; align-items: stretch; }
  .aix-btn { justify-content: center; }
  .aix-glow { filter: blur(60px); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .aix-reveal { opacity: 1; transform: none; }
  .aix.is-in .aix-reveal { transition: none; }
  .aix-glow,
  .aix-btn--primary::after { animation: none; }
  .aix-circuit path { stroke-dashoffset: 0; }
  .aix.is-in .aix-circuit path { animation: none; stroke-dashoffset: 0; }
  .aix-circuit rect.aix-node { opacity: .85; }
  .aix.is-in .aix-circuit rect.aix-node { animation: none; opacity: .85; }
  .aix-btn, .aix-card { transition: none; }
}
