/* ==========================================================================
   AI LAYER  ·  .ail
   Homepage section: where AI sits in the sourcing cycle.

   Honesty contract (MESSAGING.md kill list 16 — "AI claims are scoped to B7"):
   every touchpoint on the spine carries a status chip. Exactly one reads
   "Live today"; the rest read "Next" or "Horizon" and are styled as
   deliberately quieter. The roadmap wording mirrors deck.html (Today / Next /
   The horizon) so sales and site cannot drift apart.

   Deliberately NOT here: the +8% figure from claim B7, which the bank scopes
   to the e-rfx flagship section. The live card links there instead.

   Loaded only by index.html. All rhythm comes from the --sect-* / --space-*
   scale, never fixed px.
   ========================================================================== */

.ail {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--sect-lg) 0;
  color: var(--ink-900);
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F8FD 48%, #FFFFFF 100%);
}

/* ---- Ambient field ------------------------------------------------------ */

.ail__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.ail__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(2, 3, 233, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 3, 233, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 1000px 620px at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 1000px 620px at 50% 30%, #000 20%, transparent 80%);
}

.ail__orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.ail__orb--mint { width: 460px; height: 460px; top: -140px; inset-inline-start: -110px;
  background: radial-gradient(circle, rgba(143, 255, 153, .5), transparent 68%); }
.ail__orb--blue { width: 540px; height: 540px; bottom: -220px; inset-inline-end: -140px;
  background: radial-gradient(circle, rgba(2, 3, 233, .22), transparent 68%); }

.ail__inner { position: relative; z-index: 1; }

/* ---- Head --------------------------------------------------------------- */

.ail__head { max-width: 760px; }

.ail__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  border: 1px solid var(--divider);
  box-shadow: 0 2px 10px rgba(36, 49, 94, .05);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-blue);
}
.ail__eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 0 3px rgba(143, 255, 153, .25);
  animation: ail-breathe 2.6s var(--ease-in-out) infinite;
}
@keyframes ail-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(143, 255, 153, .25); }
  50%      { box-shadow: 0 0 0 7px rgba(143, 255, 153, 0); }
}

.ail__title {
  margin: var(--space-md) 0 0;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 800;
  text-wrap: balance;
}
.ail__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand-blue) 0%, #0021E1 40%, #00A6C4 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.ail__lead {
  margin: var(--space-sm) 0 0;
  font-size: clamp(15.5px, 1.1vw, 18px);
  line-height: 1.62;
  color: var(--ink-600);
  max-width: 62ch;
}

/* ---- The spine: AI across the cycle ------------------------------------- */

.ail__spine { margin-top: var(--space-xl); }

.ail__rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-sm);
}
/* The connecting line runs behind the cards, through the node row. */
.ail__rail::before {
  content: "";
  position: absolute;
  inset-inline: 6%;
  /* Tracks the node centre: card padding-top + half the 38px node. */
  top: calc(var(--space-md) + 19px);
  transform: translateY(-1px);
  height: 2px;
  background: linear-gradient(90deg,
    rgba(2, 3, 233, .10) 0%,
    rgba(2, 3, 233, .10) 38%,
    var(--accent-mint) 50%,
    rgba(2, 3, 233, .10) 62%,
    rgba(2, 3, 233, .10) 100%);
  z-index: 0;
}

.ailc {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm) var(--space-md);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--divider);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s var(--ease-out);
}
.ailc:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }

.ailc__node {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-blue-soft);
  border: 1px solid var(--divider);
  color: var(--brand-blue);
  flex: none;
}
.ailc__node svg { width: 19px; height: 19px; stroke-width: 1.9; }

.ailc__stage {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-400);
}
.ailc__what { font-size: 15.5px; line-height: 1.35; font-weight: 700; letter-spacing: -.015em; }
.ailc__desc { font-size: 13.5px; line-height: 1.5; color: var(--ink-600); }

/* Status chip. The whole honesty contract is carried here. */
.ailc__chip {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.ailc__chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.ailc__chip--live {
  background: var(--surface-green-soft);
  color: #1F7A33;
}
.ailc__chip--next { background: var(--surface-blue-soft); color: var(--ink-600); }
.ailc__chip--horizon { background: transparent; border: 1px dashed var(--divider); color: var(--ink-400); }

/* The one shipped capability is the visual anchor: brighter, lifted, ringed. */
.ailc--live {
  background: #FFFFFF;
  border-color: rgba(143, 255, 153, .55);
  box-shadow: 0 10px 34px rgba(36, 49, 94, .10), 0 0 0 4px rgba(143, 255, 153, .14);
}
.ailc--live .ailc__node {
  background: linear-gradient(140deg, var(--tx-d2), var(--tx-d4));
  border-color: transparent;
  color: var(--accent-mint);
}
.ailc--live .ailc__what { color: var(--ink-900); }

/* Roadmap items read as genuinely lighter than the shipped one. */
.ailc--soon { background: rgba(255, 255, 255, .58); }
.ailc--soon .ailc__what { color: var(--ink-600); }

/* ---- Console: what "Live today" actually looks like --------------------- */

.ail__console {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: var(--space-lg);
  align-items: center;
}

.ail__say .ail__sayTag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #1F7A33;
}
.ail__sayH {
  margin: var(--space-sm) 0 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.18; letter-spacing: -.03em; font-weight: 800;
  text-wrap: balance;
}
.ail__sayP { margin: var(--space-sm) 0 0; font-size: 15.5px; line-height: 1.62; color: var(--ink-600); }

.ail__guard {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: 12px;
  background: var(--surface-blue-soft);
  border-inline-start: 2px solid var(--brand-blue);
  font-size: 13.5px; line-height: 1.55; color: var(--ink-600);
}
.ail__guard b { color: var(--ink-900); }

.ail__more {
  margin-top: var(--space-md);
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 700;
  color: var(--brand-blue); text-decoration: none;
}
.ail__more svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.ail__more:hover svg { transform: translateX(4px); }
[dir="rtl"] .ail__more svg { transform: scaleX(-1); }
[dir="rtl"] .ail__more:hover svg { transform: scaleX(-1) translateX(4px); }

/* ---- The product mockup ------------------------------------------------- */

.mockai {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--tx-d0) 0%, var(--tx-d1) 62%, var(--tx-d2) 100%);
  box-shadow: 0 26px 70px rgba(1, 5, 25, .34);
  color: #FFFFFF;
}
.mockai__rail { height: var(--tx-rail-h); background: var(--tx-rail); }

.mockai__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: 13px var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.mockai__id { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.mockai__id span { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .5); letter-spacing: 0; }
.mockai__round {
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: rgba(143, 255, 153, .12);
  border: 1px solid rgba(143, 255, 153, .3);
  color: var(--accent-mint);
  font-size: 11px; font-weight: 800; letter-spacing: .05em; white-space: nowrap;
}

.mockai__head, .mockai__row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1.05fr);
  gap: var(--space-sm);
  align-items: center;
  padding: 11px var(--space-md);
}
.mockai__head {
  font-size: 10.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.mockai__row { border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 13.5px; }
.mockai__item { font-weight: 600; }
.mockai__price { font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .84); }

.mockai__sig {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.mockai__sig svg { width: 12px; height: 12px; flex: none; }
.mockai__sig--high { background: rgba(255, 160, 61, .14); color: #FFC489; }
.mockai__sig--ok   { background: rgba(143, 255, 153, .13); color: var(--accent-mint); }

/* Rows stagger in when the section is revealed. */
.mockai__row { opacity: 0; transform: translateY(8px); }
.ail.is-in .mockai__row {
  animation: ail-row-in .55s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 130ms + 180ms);
}
@keyframes ail-row-in { to { opacity: 1; transform: none; } }

.mockai__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md) var(--space-md);
}
.mockai__note { font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, .5); max-width: 40ch; }
.mockai__cta {
  position: relative; overflow: hidden;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--accent-lime); color: #001277;
  font-size: 13px; font-weight: 800; letter-spacing: -.01em;
  white-space: nowrap;
}
.ail.is-in .mockai__cta::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .65) 50%, transparent 80%);
  animation: ail-sheen 3.4s var(--ease-in-out) 1.4s infinite;
}
@keyframes ail-sheen {
  0%       { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

/* ---- Reveal ------------------------------------------------------------- */

.ail [data-ail-rise] { opacity: 0; transform: translateY(18px); }
.ail.is-in [data-ail-rise] {
  animation: ail-rise .7s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes ail-rise { to { opacity: 1; transform: none; } }

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 1080px) {
  .ail__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ail__rail::before { display: none; }
  .ail__console { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .ail { padding: var(--sect-md) 0; }
  .ail__rail { grid-template-columns: minmax(0, 1fr); }
  .ailc__chip { margin-top: var(--space-2xs); }
  .mockai__head, .mockai__row { grid-template-columns: minmax(0, 1fr) auto; }
  .mockai__head span:nth-child(2), .mockai__price { display: none; }
  .mockai__foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .ail [data-ail-rise],
  .ail .mockai__row { opacity: 1; transform: none; animation: none; }
  .ail__eyebrow .dot,
  .ail.is-in .mockai__cta::after { animation: none; }
}
