/* IntelliAI Solutions - Supplemental styles
   Tailwind handles utilities. This file owns:
   - root tokens & font wiring
   - custom animations, gradient mesh, glow
   - chat widget styles
   - scrollbar polish
*/

:root {
  --brand-50:#E6F4F7;
  --brand-100:#C0E3EB;
  --brand-200:#94CFDD;
  --brand-300:#5FB4C9;
  --brand-400:#2D94B0;
  --brand-500:#0B4F6C;
  --brand-600:#09455F;
  --brand-700:#073A50;
  --brand-800:#053040;
  --brand-900:#04303F;
  --cyan-500:#01BAEF;
  --violet-500:#7C3AED;
  --ink-50:#F8FAFC;
  --ink-900:#0F172A;
  --success:#10B981;
  --warning:#F59E0B;
  --danger:#EF4444;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: 'ss01','cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: #FFFFFF;
  color: var(--ink-900);
}

h1, h2, h3, .font-display {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.font-mono, code, pre { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; }

/* Selection */
::selection { background: var(--brand-500); color:#fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Header / nav ---------- */
.iai-header {
  transition: background-color .25s ease, backdrop-filter .25s ease, box-shadow .25s ease, border-color .25s ease;
  border-bottom: 1px solid rgba(15, 23, 42, 0);
}
.iai-header.is-scrolled {
  /* Solid-enough bg without backdrop-filter — see note below.
     `backdrop-filter` creates a new containing block for position:fixed
     descendants, which broke the mobile menu (it was being positioned
     relative to the 64px-tall header instead of the viewport, so it
     rendered tiny and let page content show through). */
  background: rgba(255,255,255,0.96);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 rgba(15,23,42,0.04), 0 8px 24px -16px rgba(11,79,108,0.18);
}

/* -------- Mobile nav menu — bulletproof opaque overlay -------------------
   Bypasses Tailwind's data-* variants (which had patchy support in some
   mobile browsers) and guarantees a solid white sheet over the page,
   above the header, with smooth open/close. ----------------------------- */
#iai-mobile-menu {
  z-index: 60;                         /* above the header (z-50) */
  background: #ffffff !important;       /* always opaque */
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: opacity 200ms ease, transform 200ms ease;
}
#iai-mobile-menu[data-open="false"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
#iai-mobile-menu[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
@media (min-width: 768px) {
  #iai-mobile-menu { display: none !important; }
}

/* Animated gradient underline for key links */
.iai-link {
  position: relative;
  padding-bottom: 2px;
}
.iai-link::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--cyan-500));
  border-radius: 2px;
  transition: right .35s cubic-bezier(.22,.61,.36,1);
}
.iai-link:hover::after,
.iai-link[aria-current="page"]::after { right: 0; }

/* ---------- Gradient mesh hero blob ---------- */
.iai-mesh {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 720px;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px) saturate(140%);
  opacity: .55;
  background:
    radial-gradient(40% 60% at 20% 30%, rgba(1,186,239,0.45), transparent 60%),
    radial-gradient(35% 55% at 75% 20%, rgba(124,58,237,0.30), transparent 65%),
    radial-gradient(40% 50% at 60% 70%, rgba(11,79,108,0.45), transparent 65%);
}
.iai-mesh--soft { opacity: .35; height: 520px; }

/* Subtle grid backdrop */
.iai-grid-bg {
  background-image:
    linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 70%);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: transform, opacity;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Marquee ---------- */
.iai-marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.iai-marquee__track {
  display: inline-flex;
  gap: 3rem;
  white-space: nowrap;
  animation: iai-marquee 40s linear infinite;
  padding-right: 3rem;
}
@keyframes iai-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.iai-marquee:hover .iai-marquee__track { animation-play-state: paused; }

/* ---------- Glow / card hover ---------- */
.iai-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, border-color .35s ease;
}
.iai-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11,79,108,0.18);
  box-shadow: 0 20px 40px -24px rgba(11,79,108,0.25);
}
.iai-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-50), #fff);
  color: var(--brand-500);
  border: 1px solid rgba(11,79,108,0.12);
}

/* Pricing card highlight */
.iai-price--featured {
  background: linear-gradient(180deg, #04303F, #0B4F6C);
  color: #fff;
  border-color: transparent;
}
.iai-price--featured .iai-card__icon { background: rgba(255,255,255,0.10); color:#fff; border-color: rgba(255,255,255,0.18); }

/* ---------- Buttons ---------- */
.iai-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.15rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: .95rem;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
  cursor: pointer;
}
.iai-btn:active { transform: translateY(1px); }
.iai-btn--primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(11,79,108,0.55);
}
.iai-btn--primary:hover { background: var(--brand-600); box-shadow: 0 14px 28px -10px rgba(11,79,108,0.6); }
.iai-btn--ghost {
  background: rgba(255,255,255,0.6);
  color: var(--ink-900);
  border-color: rgba(15,23,42,0.12);
  backdrop-filter: blur(8px);
}
.iai-btn--ghost:hover { border-color: rgba(15,23,42,0.25); background: #fff; }
.iai-btn--dark {
  background: var(--ink-900); color:#fff;
}
.iai-btn--dark:hover { background:#1e293b; }
.iai-btn--outline {
  background: transparent; color: var(--brand-500); border-color: rgba(11,79,108,0.25);
}
.iai-btn--outline:hover { border-color: var(--brand-500); background: var(--brand-50); }

/* Pill / badge */
.iai-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid rgba(11,79,108,0.12);
}
.iai-pill--dark {
  background: rgba(255,255,255,0.06);
  color: #E6F4F7;
  border-color: rgba(255,255,255,0.14);
}

/* ---------- Stat ---------- */
.iai-stat__num {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--ink-900), #334155);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- Methodology timeline ---------- */
.iai-timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 1024px) {
  .iai-timeline { grid-template-columns: repeat(5, 1fr); }
  .iai-timeline::before {
    content:'';
    position: absolute;
    top: 28px; left: 4%; right: 4%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(11,79,108,0.25), rgba(1,186,239,0.4), rgba(11,79,108,0.25), transparent);
  }
}
.iai-timeline__dot {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(11,79,108,0.18);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-500);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: 0 6px 18px -10px rgba(11,79,108,0.35);
  position: relative;
  z-index: 1;
}

/* ---------- FAQ accordion ---------- */
details.iai-faq {
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 14px;
  background:#fff;
  transition: border-color .25s ease, box-shadow .25s ease;
}
details.iai-faq[open] {
  border-color: rgba(11,79,108,0.25);
  box-shadow: 0 12px 28px -20px rgba(11,79,108,0.35);
}
details.iai-faq > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-weight: 500;
  color: var(--ink-900);
}
details.iai-faq > summary::-webkit-details-marker { display: none; }
details.iai-faq > summary .iai-faq__icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-50);
  color: var(--brand-500);
  transition: transform .25s ease;
  flex-shrink: 0;
}
details.iai-faq[open] > summary .iai-faq__icon { transform: rotate(45deg); }
details.iai-faq > .iai-faq__body {
  padding: 0 1.25rem 1.2rem;
  color: #475569;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.iai-footer { background: var(--ink-900); color: #cbd5e1; }
.iai-footer a { color: #cbd5e1; }
.iai-footer a:hover { color: #fff; }
.iai-footer h4 { color:#fff; }

/* ---------- Toast ---------- */
.iai-toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-900);
  color: #fff;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 24px 40px -20px rgba(0,0,0,0.4);
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 80;
  display: inline-flex; align-items: center; gap: .6rem;
}
.iai-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.iai-toast--success { background:#065f46; }
.iai-toast--error { background:#7f1d1d; }

/* ---------- Sidebar (service page) ---------- */
.iai-sidenav a {
  display: block;
  padding: .55rem .8rem;
  border-radius: 10px;
  color: #475569;
  font-size: .9rem;
  transition: background .2s ease, color .2s ease;
  border-left: 2px solid transparent;
}
.iai-sidenav a:hover { background: var(--brand-50); color: var(--brand-700); }
.iai-sidenav a.is-active {
  background: var(--brand-50);
  color: var(--brand-700);
  border-left-color: var(--brand-500);
  font-weight: 500;
}

/* ============================================================
   CHATBOT WIDGET
   ============================================================ */
.iai-chat { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90; font-family: 'Inter', sans-serif; }

/* Launcher */
.iai-chat__launcher {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0B4F6C 0%, #01BAEF 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 18px 36px -12px rgba(11,79,108,0.6), 0 6px 14px -6px rgba(1,186,239,0.4);
  transition: transform .25s ease, box-shadow .25s ease;
}
.iai-chat__launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 22px 40px -10px rgba(11,79,108,0.7); }
.iai-chat__launcher svg { width: 26px; height: 26px; }
.iai-chat__pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(1,186,239,0.5);
  animation: iai-pulse 2.2s ease-out infinite;
  z-index: -1;
}
@keyframes iai-pulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Panel */
.iai-chat__panel {
  position: absolute;
  bottom: 76px; right: 0;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 32px 60px -20px rgba(15,23,42,0.35), 0 8px 24px -12px rgba(15,23,42,0.18);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: bottom right;
  animation: iai-chat-in .35s cubic-bezier(.22,.61,.36,1);
}
.iai-chat[data-open="true"] .iai-chat__panel { display: flex; }
.iai-chat[data-open="true"] .iai-chat__launcher { transform: scale(0.92); }

@keyframes iai-chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.iai-chat__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem;
  background: linear-gradient(135deg, #04303F 0%, #0B4F6C 100%);
  color: #fff;
}
.iai-chat__brand { display: flex; align-items: center; gap: .65rem; }
.iai-chat__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #01BAEF, #7C3AED);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem;
  font-family: 'Inter Tight', sans-serif;
  letter-spacing: -0.02em;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18);
}
.iai-chat__title { margin: 0; font-size: .92rem; font-weight: 600; }
.iai-chat__status { margin: 1px 0 0; font-size: .72rem; color: rgba(230,244,247,0.85); display: inline-flex; align-items: center; gap: .35rem; }
.iai-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 4px rgba(16,185,129,0.25); }
.iai-chat__close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.iai-chat__close:hover { background: rgba(255,255,255,0.2); }
.iai-chat__close svg { width: 16px; height: 16px; }

/* Messages */
.iai-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.iai-msg {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  max-width: 86%;
  animation: iai-msg-in .25s ease-out;
}
@keyframes iai-msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.iai-msg__bubble {
  padding: .65rem .85rem;
  border-radius: 16px;
  font-size: .88rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.iai-msg__mini-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #01BAEF, #7C3AED);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 600;
  font-family: 'Inter Tight', sans-serif;
  flex-shrink: 0;
}
.iai-bot .iai-msg__bubble {
  background: #fff;
  color: var(--ink-900);
  border: 1px solid rgba(15,23,42,0.06);
  border-bottom-left-radius: 4px;
}
.iai-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.iai-user .iai-msg__bubble {
  background: var(--brand-500);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.iai-user .iai-msg__mini-avatar { display: none; }

/* Typing */
.iai-typing { display: inline-flex; gap: 4px; padding: .85rem .85rem; }
.iai-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: iai-blink 1.2s infinite ease-in-out both;
}
.iai-typing span:nth-child(2) { animation-delay: .15s; }
.iai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes iai-blink {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Download chip */
.iai-msg__download {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: .5rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid rgba(11,79,108,0.18);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease;
}
.iai-msg__download:hover { background: var(--brand-100); }
.iai-msg__download svg { width: 14px; height: 14px; }

/* Handoff */
.iai-msg__handoff {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: .5rem;
  padding: .55rem .85rem;
  border-radius: 10px;
  background: #25D366;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
}
.iai-msg__handoff:hover { background: #1ebd58; }

/* Quick replies — wrap to multiple rows, but cap the total height so the
   message thread always keeps a comfortable amount of vertical real estate.
   When the options exceed the cap, the container scrolls vertically with a
   thin scrollbar and a soft bottom-edge fade hints at the overflow.        */
.iai-chat__quickreplies {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .5rem 1rem .625rem;
  background: #F8FAFC;
  max-height: min(38%, 180px);    /* ~4–5 button rows on a typical panel */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(11,79,108,0.25) transparent;
  /* Soft fade at the bottom only when overflow is present */
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 14px), rgba(0,0,0,0.6) 100%);
          mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 14px), rgba(0,0,0,0.6) 100%);
}
.iai-chat__quickreplies::-webkit-scrollbar { width: 5px; }
.iai-chat__quickreplies::-webkit-scrollbar-thumb {
  background: rgba(11,79,108,0.25);
  border-radius: 999px;
}
.iai-chat__quickreplies:empty { display: none; }
.iai-qr {
  flex: 0 1 auto;                 /* let buttons share rows when labels are short */
  white-space: nowrap;            /* keep each label on a single line */
  background: #fff;
  border: 1px solid rgba(11,79,108,0.18);
  color: var(--brand-700);
  padding: .42rem .75rem;
  font-size: .78rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  font-family: inherit;
}
.iai-qr:hover { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }

/* Composer */
.iai-chat__composer {
  display: flex; gap: .5rem;
  padding: .65rem .75rem .65rem 1rem;
  border-top: 1px solid rgba(15,23,42,0.06);
  background: #fff;
}
.iai-chat__composer input {
  flex: 1;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 999px;
  padding: .6rem .9rem;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.iai-chat__composer input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(11,79,108,0.12);
}
.iai-chat__composer button {
  border: none;
  background: var(--brand-500);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.iai-chat__composer button:hover { background: var(--brand-600); transform: scale(1.05); }
.iai-chat__composer button svg { width: 18px; height: 18px; }

.iai-chat__foot {
  margin: 0;
  padding: .5rem 1rem .7rem;
  font-size: .7rem;
  color: #64748b;
  text-align: center;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,0.04);
}
.iai-chat__foot a { color: var(--brand-500); text-decoration: none; font-weight: 500; }
.iai-chat__foot a:hover { text-decoration: underline; }

/* Mobile chat: full screen */
@media (max-width: 480px) {
  .iai-chat { right: 1rem; bottom: 1rem; }
  .iai-chat__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    bottom: 0;
  }
}

/* Tiny screens */
@media (max-width: 360px) {
  .iai-chat__launcher { width: 54px; height: 54px; }
}

/* ============================================================
   PHASE 2 — POLISH: BACKGROUND PATTERNS, IMAGERY, MOTION
   ============================================================ */

/* ---------- Background patterns (subtle, themable) ---------- */
:root { --pattern-ink: 15,23,42; }   /* slate-900 RGB */

.bg-grid {
  background-color: #FAFBFC;
  background-image:
    linear-gradient(rgba(var(--pattern-ink),0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--pattern-ink),0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.bg-dots {
  background-color: #FAFBFC;
  background-image: radial-gradient(rgba(var(--pattern-ink),0.07) 1px, transparent 1.4px);
  background-size: 22px 22px;
}

.bg-cross {
  background-color: #F8FAFC;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><path d='M19 0v40M0 19h40' stroke='rgb(15,23,42)' stroke-opacity='0.05' stroke-width='1' /></svg>");
  background-size: 40px 40px;
}

/* Masked-edge variant — pattern fades to transparent at top/bottom */
.bg-grid--masked {
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

/* ---------- Reveal v2 (data-reveal upgrade with direction variants) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
[data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
[data-reveal="right"] { transform: translate3d(32px, 0, 0); }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* ---------- Counters ---------- */
[data-counter] {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* ---------- Magnetic CTA helper ---------- */
.iai-magnetic {
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ---------- Hero image card (with mock browser chrome) ---------- */
.iai-hero-card {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(135deg, #E6F4F7 0%, #FFFFFF 100%);
  box-shadow: 0 40px 80px -32px rgba(11, 79, 108, 0.45),
              0 18px 36px -18px rgba(15, 23, 42, 0.18),
              0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.iai-hero-card::before {
  content: '';
  display: block;
  height: 28px;
  background: linear-gradient(180deg, #F8FAFC, #F1F5F9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background-image:
    radial-gradient(circle at 14px 14px, #EF4444 4px, transparent 4.5px),
    radial-gradient(circle at 32px 14px, #F59E0B 4px, transparent 4.5px),
    radial-gradient(circle at 50px 14px, #10B981 4px, transparent 4.5px);
  background-repeat: no-repeat;
}
.iai-hero-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.iai-hero-card__stat {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  box-shadow: 0 12px 28px -16px rgba(11, 79, 108, 0.45);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-900);
  max-width: 220px;
}
.iai-hero-card__stat-num {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--brand-500);
  letter-spacing: -0.02em;
}

/* ---------- Image utilities ---------- */
.iai-img-frame {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
}
.iai-img-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.iai-img-16x9 { aspect-ratio: 16 / 9; }
.iai-img-4x3  { aspect-ratio: 4 / 3; }
.iai-img-1x1  { aspect-ratio: 1 / 1; }

/* Case study image with brand gradient mask at bottom for text contrast */
.iai-img-caseframe {
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  margin: -1.75rem -1.75rem 1.25rem;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
}
.iai-img-caseframe img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.iai-img-caseframe::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 48, 63, 0.55) 100%);
  pointer-events: none;
}
.iai-card:hover .iai-img-caseframe img { transform: scale(1.04); }

/* Industries thumbnail */
.iai-ind-thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Service section image (right of headline) */
.iai-service-img {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--brand-50), #fff);
  box-shadow: 0 20px 40px -28px rgba(11, 79, 108, 0.4);
}
.iai-service-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.iai-service-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11,79,108,0.0) 60%, rgba(11,79,108,0.18) 100%);
  pointer-events: none;
}

/* Contact info column with office image background */
.iai-contact-aside {
  position: relative;
  isolation: isolate;
  border-radius: 18px;
  overflow: hidden;
}
.iai-contact-aside__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.iai-contact-aside__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.iai-contact-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(140deg, rgba(255,255,255,0.94) 0%, rgba(248, 250, 252, 0.86) 60%, rgba(230, 244, 247, 0.85) 100%);
}

/* ---------- Header polish: animated underline border ---------- */
.iai-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-500), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.iai-header.is-scrolled::after { transform: scaleX(1); }

/* ---------- Hero entry letter cascade ---------- */
.iai-hero-h1 .iai-letter {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.6em, 0);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
body.is-loaded .iai-hero-h1 .iai-letter {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.iai-hero-sub,
.iai-hero-ctas,
.iai-hero-trust {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
body.is-loaded .iai-hero-sub   { opacity: 1; transform: translate3d(0, 0, 0); transition-delay: 200ms; }
body.is-loaded .iai-hero-ctas  { opacity: 1; transform: translate3d(0, 0, 0); transition-delay: 400ms; }
body.is-loaded .iai-hero-trust { opacity: 1; transform: translate3d(0, 0, 0); transition-delay: 600ms; }

/* ---------- Card hover micro-interactions ---------- */
@media (hover: hover) {
  .iai-card:hover .iai-card__icon {
    transform: translateX(4px);
    transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* ---------- Reduced motion: nuke everything ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .iai-hero-h1 .iai-letter { opacity: 1; transform: none; }
  .iai-hero-sub, .iai-hero-ctas, .iai-hero-trust { opacity: 1; transform: none; }
  .iai-marquee__track { animation: none !important; }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .iai-magnetic { transform: none !important; }
}

/* ============================================================
   PHASE 3 — MODERN METHODOLOGY TIMELINE
   ============================================================ */
.iai-method {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.iai-method__step {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.125rem;
  align-items: start;
}
.iai-method__num {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-500, #0B4F6C) 0%, #01BAEF 100%);
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 2;
  box-shadow:
    0 6px 18px -8px rgba(11, 79, 108, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: 0 0 56px;
}
/* Vertical connector line (mobile / tablet) */
.iai-method__step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 56px;
  width: 2px;
  height: calc(100% + 1.25rem);
  background: linear-gradient(180deg,
              rgba(1, 186, 239, 0.65) 0%,
              rgba(1, 186, 239, 0.12) 100%);
  border-radius: 2px;
  z-index: 1;
}
.iai-method__card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  padding: 1rem 1.125rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition:
    transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 250ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .iai-method__card:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 79, 108, 0.18);
    box-shadow: 0 14px 30px -18px rgba(11, 79, 108, 0.25);
  }
}
.iai-method__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.iai-method__head h3 {
  font-family: "Inter Tight", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.0625rem;
  color: #0F172A;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
}
.iai-method__weeks {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #475569;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.iai-method__card p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
}

/* Desktop: horizontal timeline with segmented connectors between badges */
@media (min-width: 1024px) {
  .iai-method {
    flex-direction: row;
    gap: 0;
    align-items: stretch;
  }
  /* Kill the old continuous through-line */
  .iai-method::before { display: none; }

  .iai-method__step {
    flex: 1 1 0;
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto;
    grid-auto-flow: row;
    gap: 1.25rem;
    padding: 0 0.75rem;
    justify-items: center;
    text-align: left;
    position: relative;
  }
  .iai-method__step::before { display: none !important; }

  /* Connector segment from THIS badge's right edge to the NEXT badge's left edge.
     The badge is 56px wide and centred at 50% of the step; with a 12px clear-zone
     either side, the segment starts at calc(50% + 28px + 12px) and stretches into
     the next step, ending the same distance before its badge centre.            */
  .iai-method__step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 27px;                          /* badge vertical centre minus half line height */
    left: calc(50% + 40px);
    right: calc(-50% + 40px);
    height: 2px;
    background: linear-gradient(90deg,
                rgba(1, 186, 239, 0.55) 0%,
                rgba(1, 186, 239, 0.85) 50%,
                rgba(1, 186, 239, 0.55) 100%);
    border-radius: 999px;
    box-shadow: 0 1px 4px -1px rgba(1, 186, 239, 0.45);
    z-index: 0;
  }
  /* Tiny end-cap dots at each side of the connector — anchors it to the badges */
  .iai-method__step:not(:last-child) .iai-method__num::after,
  .iai-method__step + .iai-method__step .iai-method__num::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #01BAEF;
    z-index: 1;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  }
  .iai-method__step:not(:last-child) .iai-method__num::after { right: -10px; }
  .iai-method__step + .iai-method__step .iai-method__num::before { left: -10px; }

  .iai-method__num {
    margin: 0 auto;
    z-index: 3;          /* always above the connector */
  }
  .iai-method__card { width: 100%; }
}

/* ============================================================
   PHASE 3 — CHAT BUBBLE MARKDOWN RENDERING
   ============================================================ */
.iai-bot .iai-msg__bubble {
  line-height: 1.55;
  word-break: break-word;
  font-size: 0.9375rem;
}
.iai-bot .iai-msg__bubble strong {
  font-weight: 600;
  color: #0F172A;
}
.iai-bot .iai-msg__bubble em {
  font-style: italic;
}
.iai-bot .iai-msg__bubble a {
  color: var(--brand-500, #0B4F6C);
  text-decoration: underline;
  text-decoration-color: rgba(11, 79, 108, 0.4);
  text-underline-offset: 2px;
  word-break: break-all;
}
.iai-bot .iai-msg__bubble a:hover {
  text-decoration-color: var(--brand-500, #0B4F6C);
}
.iai-bot .iai-msg__bubble .iai-md-p {
  margin: 0;
}
.iai-bot .iai-msg__bubble .iai-md-p + .iai-md-p,
.iai-bot .iai-msg__bubble .iai-md-list + .iai-md-p,
.iai-bot .iai-msg__bubble .iai-md-p + .iai-md-list {
  margin-top: 0.5rem;
}
.iai-bot .iai-msg__bubble .iai-md-gap {
  height: 0.4rem;
}
.iai-bot .iai-msg__bubble .iai-md-list {
  list-style: none;
  padding: 0.25rem 0 0 0;
  margin: 0;
}
.iai-bot .iai-msg__bubble .iai-md-list li {
  position: relative;
  padding-left: 1.1rem;
  margin: 0.2rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.iai-bot .iai-msg__bubble .iai-md-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-500, #0B4F6C);
  opacity: 0.55;
}
.iai-bot .iai-msg__bubble .iai-md-list li strong:first-child {
  color: var(--brand-500, #0B4F6C);
}

/* Ensure messages container scrolls cleanly and bubble never clips */
.iai-chat__messages {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}
.iai-chat__messages::-webkit-scrollbar { width: 6px; }
.iai-chat__messages::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}
.iai-msg__bubble {
  max-width: 88%;
  padding: 0.65rem 0.875rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================================
   PHASE 3 — MOBILE TYPOGRAPHY & SPACING POLISH
   ============================================================ */
@media (max-width: 640px) {
  /* Tighter section padding on mobile */
  section.py-20,
  section.py-24,
  section.py-28,
  section.py-32 {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Smaller, modern hero scale on phones */
  .iai-hero-h1,
  h1.font-display {
    font-size: clamp(1.875rem, 8vw, 2.5rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -0.025em;
  }
  h2.font-display {
    font-size: clamp(1.5rem, 6.5vw, 2rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em;
  }
  h3.font-display {
    font-size: 1.0625rem !important;
    line-height: 1.25 !important;
  }

  /* Body & supporting text — readable and compact */
  p, li {
    font-size: 0.9375rem;
    line-height: 1.55;
  }
  .text-sm { font-size: 0.8125rem; }

  /* Cards / containers tighter padding on mobile */
  .iai-card { padding: 1.25rem !important; }

  /* Methodology — slimmer numbers on tight screens */
  .iai-method__num {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 12px;
  }
  .iai-method__step {
    grid-template-columns: 48px 1fr;
    gap: 0.875rem;
  }
  .iai-method__step:not(:last-child)::before {
    left: 23px;
    top: 48px;
  }
  .iai-method__head h3 { font-size: 1rem; }

  /* Top nav — tighter brand and CTA on mobile */
  .iai-btn {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.8125rem !important;
  }

  /* Tame the hero floating image card so it doesn't dominate mobile */
  .iai-hero-card { transform: none !important; }

  /* Case-study cards — comfortable mobile padding */
  .iai-card.p-7 { padding: 1.25rem !important; }
  .iai-card.p-8 { padding: 1.5rem !important; }

  /* Pricing cards — readable price text */
  .font-mono { font-size: 0.875rem; }
}

/* Very small phones — go even tighter */
@media (max-width: 380px) {
  .iai-hero-h1,
  h1.font-display {
    font-size: 1.75rem !important;
  }
  section.py-20,
  section.py-24,
  section.py-28,
  section.py-32 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .max-w-7xl { padding-left: 1rem !important; padding-right: 1rem !important; }
}

/* Improve chat widget readability on small phones */
@media (max-width: 480px) {
  .iai-chat__panel {
    font-size: 0.9375rem;
  }
  .iai-chat__messages {
    padding: 0.875rem !important;
  }
  .iai-msg__bubble {
    max-width: 92%;
    padding: 0.625rem 0.8125rem;
  }
  .iai-qr {
    font-size: 0.8125rem !important;
  }
  .iai-chat__composer input {
    font-size: 16px !important;  /* prevents iOS zoom on focus */
  }
}

/* ============================================================
   PHASE 3 — WHATSAPP FLOATING ACTION BUTTON (bottom-left, mirrors chat launcher)
   ============================================================ */
.iai-wa {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25D366;                       /* official WhatsApp green */
  color: #ffffff;
  text-decoration: none;
  z-index: 90;
  isolation: isolate;                        /* contain the pulse */
  box-shadow:
    0 14px 30px -10px rgba(37, 211, 102, 0.55),
    0 4px 12px -4px rgba(0, 0, 0, 0.18);
  transition:
    transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.iai-wa:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 22px 40px -10px rgba(37, 211, 102, 0.7),
    0 6px 16px -6px rgba(0, 0, 0, 0.22);
}
.iai-wa:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 3px;
}
.iai-wa__icon {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.iai-wa__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.55);
  z-index: 1;
  animation: iaiWaPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes iaiWaPulse {
  0%   { transform: scale(1);    opacity: 0.65; }
  70%  { transform: scale(1.6);  opacity: 0;    }
  100% { transform: scale(1.6);  opacity: 0;    }
}
/* Tooltip on hover (desktop only) */
.iai-wa::after {
  content: "Chat on WhatsApp";
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: #0F172A;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.3);
}
.iai-wa::before {
  content: "";
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #0F172A;
  opacity: 0;
  transition: opacity 200ms ease;
}
@media (hover: hover) {
  .iai-wa:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
  .iai-wa:hover::before { opacity: 1; }
}

/* Mobile sizing — mirror the chat launcher */
@media (max-width: 480px) {
  .iai-wa { left: 1rem; bottom: 1rem; width: 54px; height: 54px; }
  .iai-wa__icon { width: 27px; height: 27px; }
  .iai-wa::after, .iai-wa::before { display: none; }   /* no tooltip on phones */
}
@media (max-width: 360px) {
  .iai-wa { width: 50px; height: 50px; }
  .iai-wa__icon { width: 25px; height: 25px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .iai-wa { transition: none; }
  .iai-wa__pulse { animation: none; opacity: 0.25; }
  .iai-wa:hover { transform: none; }
}

/* ============================================================
   PHASE 4 — CORPORATE EDITORIAL REDESIGN
   Sand / paper palette, editorial type scale, eyebrow labels,
   index lists, statement sections, quiet motion.
   ============================================================ */
:root {
  /* Editorial type scale */
  --fs-display: clamp(2.5rem, 5.5vw, 4.5rem);
  --fs-h1:      clamp(2rem, 4vw, 3.25rem);
  --fs-h2:      clamp(1.5rem, 2.8vw, 2.25rem);
  --fs-h3:      clamp(1.125rem, 1.6vw, 1.375rem);
  --fs-lead:    clamp(1.125rem, 1.4vw, 1.375rem);
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-eyebrow: 0.75rem;
  --lh-tight:   1.05;
  --lh-snug:    1.2;
  --lh-base:    1.55;

  /* Warm sand / paper neutrals */
  --sand-50:  #FAF7F2;
  --sand-100: #F2EDE3;
  --sand-200: #E5DDCB;
  --paper:    #FCFBF8;
  --ink-700:  #1E293B;
  --ink-500:  #475569;
  --ink-400:  #64748B;
  --rule:     rgba(15, 23, 42, 0.10);
}

/* Page-level paper background option (applied via body class on redesigned pages) */
body.iai-corp { background: var(--paper); }

/* ---------- Eyebrow ---------- */
.iai-eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-500);
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 500;
}
.iai-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}
.iai-eyebrow--ink { color: var(--ink-500); }
.iai-eyebrow--light { color: rgba(255,255,255,0.7); }

/* ---------- Editorial display headings ---------- */
.iai-display {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink-900);
}
.iai-h1 {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: -0.022em;
  font-weight: 600;
}
.iai-h2 {
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  font-weight: 600;
}
.iai-lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--ink-500);
}

/* ---------- Section backgrounds ---------- */
.iai-sand   { background: var(--sand-50); }
.iai-sand-2 { background: var(--sand-100); }
.iai-paper  { background: var(--paper); }
.iai-ink    { background: var(--ink-900); color: #E5E7EB; }
.iai-rule-t { border-top: 1px solid var(--rule); }
.iai-rule-b { border-bottom: 1px solid var(--rule); }

/* ---------- Editorial section spacing ---------- */
.iai-sec {
  padding-top: clamp(4rem, 9vw, 8rem);
  padding-bottom: clamp(4rem, 9vw, 8rem);
}
.iai-sec--tight {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

/* ---------- Statement section (editorial pause) ---------- */
.iai-statement {
  max-width: 56rem;
}
.iai-statement p {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--ink-900);
  font-weight: 500;
}
.iai-statement--quote p::before { content: "\201C"; opacity: 0.4; margin-right: 0.05em; }
.iai-statement--quote p::after  { content: "\201D"; opacity: 0.4; margin-left: 0.05em; }

/* ---------- Inline editorial link ---------- */
.iai-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-500);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: gap .25s ease, color .25s ease;
}
.iai-link-arrow:hover { gap: 0.75rem; color: var(--brand-700); }

/* ---------- Index list (numbered editorial rows) ---------- */
.iai-index {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.iai-index > li > a,
.iai-index > li > .iai-index__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.5rem 0.5rem 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-900);
  text-decoration: none;
  position: relative;
  transition: padding-left .35s cubic-bezier(.22,.61,.36,1), background-color .35s ease;
}
@media (max-width: 640px) {
  .iai-index > li > a,
  .iai-index > li > .iai-index__row {
    grid-template-columns: 44px 1fr auto;
    gap: 1rem;
    padding: 1.1rem 0;
  }
}
.iai-index__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: var(--ink-400);
}
.iai-index__name {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  font-weight: 500;
  color: var(--ink-900);
}
.iai-index__meta {
  font-size: 0.8125rem;
  color: var(--ink-400);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.iai-index__arrow {
  width: 28px; height: 1px;
  background: var(--ink-400);
  position: relative;
  align-self: center;
  transition: width .35s cubic-bezier(.22,.61,.36,1), background-color .35s ease;
}
.iai-index__arrow::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 7px; height: 7px;
  border-top: 1px solid var(--ink-400);
  border-right: 1px solid var(--ink-400);
  transform: translateY(-50%) rotate(45deg);
  transition: border-color .35s ease;
}
@media (hover: hover) {
  .iai-index > li > a:hover {
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(11,79,108,0.04), transparent 60%);
  }
  .iai-index > li > a:hover .iai-index__num,
  .iai-index > li > a:hover .iai-index__arrow,
  .iai-index > li > a:hover .iai-index__arrow::after {
    color: var(--brand-500);
    background-color: var(--brand-500);
    border-color: var(--brand-500);
  }
  .iai-index > li > a:hover .iai-index__arrow { width: 40px; }
  .iai-index > li > a:hover .iai-index__name { color: var(--brand-700); }
}

/* ---------- Data metric (oversized mono number) ---------- */
.iai-metric {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  font-weight: 500;
}
.iai-metric--brand { color: var(--brand-500); }

/* ---------- Capability list (2-column, no icons) ---------- */
.iai-caps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .iai-caps { grid-template-columns: 1fr 1fr; }
}
.iai-caps li {
  font-size: 0.95rem;
  color: var(--ink-700);
  line-height: 1.5;
  padding-left: 1.1rem;
  position: relative;
}
.iai-caps li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.6em;
  width: 8px; height: 1px;
  background: var(--brand-500);
}

/* ---------- Editorial card (used max 2 per row) ---------- */
.iai-edcard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.iai-edcard__media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 16 / 9;
  background: var(--sand-100);
}
.iai-edcard__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}
.iai-edcard:hover .iai-edcard__media img { transform: scale(1.03); }
.iai-edcard__meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* ---------- Authority strip (small caps line) ---------- */
.iai-authority {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 500;
}
.iai-authority > span + span::before {
  content: "·";
  margin: 0 0.7rem;
  color: var(--ink-400);
}

/* ---------- Trust line (provinces, services, etc) ---------- */
.iai-trustline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.95rem;
  color: var(--ink-500);
}
.iai-trustline__sep {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-400);
  opacity: 0.5;
}

/* ---------- Scroll progress bar (top of page) ---------- */
.iai-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 70;
  background: transparent;
  pointer-events: none;
}
.iai-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-500), var(--cyan-500));
  transition: width 120ms linear;
}

/* ---------- Quiet reveal (gentler than the existing one) ---------- */
[data-reveal-quiet] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
[data-reveal-quiet].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ---------- Editorial CTA band (dark, restrained) ---------- */
.iai-cta-band {
  background: var(--ink-900);
  color: #F1F5F9;
  position: relative;
}
.iai-cta-band__inner {
  max-width: 56rem;
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
}
.iai-cta-band h2 {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  font-weight: 500;
}

/* ---------- Industry block (service.html) ---------- */
.iai-industry {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--rule);
}
.iai-industry:first-of-type { border-top: 0; padding-top: 0; }
.iai-industry__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .iai-industry__head {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: end;
  }
}
.iai-industry__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .iai-industry__body { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}

/* ---------- Disable old over-the-top motion on redesigned pages ---------- */
body.iai-corp .iai-magnetic { transform: none !important; }
body.iai-corp .iai-hero-card { transform: none !important; }
body.iai-corp .iai-hero-h1 .iai-letter { opacity: 1; transform: none; }
body.iai-corp .iai-mesh { display: none; }

/* ---------- Refined footer for corporate pages ---------- */
.iai-footer--corp {
  background: var(--ink-900);
  color: #CBD5E1;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.iai-footer--corp h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.iai-footer--corp a {
  color: #CBD5E1;
  font-size: 0.9rem;
  transition: color .2s ease;
}
.iai-footer--corp a:hover { color: #fff; }

/* Editorial pull-quote */
.iai-pullquote {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--ink-900);
  font-weight: 500;
  border-left: 2px solid var(--brand-500);
  padding-left: 1.5rem;
}
.iai-pullquote__attr {
  margin-top: 1.25rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* On corporate pages, reduce magnetic-button intrusion */
body.iai-corp .iai-btn--primary {
  box-shadow: none;
  border-radius: 6px;
}
body.iai-corp .iai-btn--primary:hover {
  box-shadow: 0 8px 20px -10px rgba(11,79,108,0.4);
}
body.iai-corp .iai-btn--ghost {
  background: transparent;
  backdrop-filter: none;
  border-radius: 6px;
}
body.iai-corp .iai-btn--outline {
  border-radius: 6px;
}
body.iai-corp .iai-pill {
  display: none; /* kill old pill style on redesigned pages */
}

/* Sticky industry sidenav (service page) */
.iai-sidenav--corp a {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.875rem;
  color: var(--ink-500);
  padding: 0.5rem 0 0.5rem 0.875rem;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  display: block;
  transition: border-color .25s ease, color .25s ease, padding-left .25s ease;
}
.iai-sidenav--corp a:hover {
  color: var(--brand-500);
  border-left-color: var(--brand-500);
  padding-left: 1.125rem;
  background: transparent;
}
.iai-sidenav--corp a.is-active {
  color: var(--brand-700);
  border-left-color: var(--brand-500);
  font-weight: 500;
  background: transparent;
}
.iai-sidenav--corp p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding-left: 0.875rem;
  margin-bottom: 0.875rem;
  font-weight: 500;
}

/* Quietly hide the marquee/bg-mesh on corporate hero — purely visual */
body.iai-corp .iai-marquee,
body.iai-corp .bg-grid--masked .iai-mesh { display: none; }

/* Reduced motion respects everything we just added */
@media (prefers-reduced-motion: reduce) {
  [data-reveal-quiet] { opacity: 1 !important; transform: none !important; }
  .iai-progress__bar { transition: none; }
}

/* ============================================================
   PHASE 4.5 — INDUSTRY IMAGERY + VISUAL STRIPS (editorial)
   ============================================================ */
.iai-industry__media {
  position: relative;
  margin: 1.75rem 0 2.25rem;
  border-radius: 14px;
  overflow: hidden;
  background: var(--sand-100, #F2EDE3);
  isolation: isolate;
}
.iai-industry__media img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}
@media (min-width: 768px) {
  .iai-industry__media img { height: 320px; }
}
.iai-industry__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,79,108,0) 55%, rgba(11,79,108,0.45) 100%);
}
.iai-industry__caption {
  position: absolute;
  left: 1.25rem;
  bottom: 0.875rem;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

/* Hero context photo on the index page — small editorial accent next to hero copy */
.iai-hero-photo {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(11,79,108,0.35),
              0 12px 28px -16px rgba(0,0,0,0.18);
  isolation: isolate;
}
.iai-hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}
.iai-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(11,79,108,0.55) 100%);
  pointer-events: none;
}
.iai-hero-photo__tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
@media (max-width: 1023px) {
  .iai-hero-photo { display: none; }
}

/* Three-up editorial image strip used between sections on the homepage */
.iai-visual-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 768px) {
  .iai-visual-strip { grid-template-columns: 1fr 1fr 1fr; }
}
.iai-visual-strip > figure {
  position: relative;
  isolation: isolate;
  margin: 0;
  overflow: hidden;
}
.iai-visual-strip img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}
.iai-visual-strip > figure:hover img { transform: scale(1.04); }
.iai-visual-strip > figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,79,108,0.05) 0%, rgba(11,79,108,0.65) 100%);
  pointer-events: none;
}
.iai-visual-strip figcaption {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.125rem;
  color: #fff;
  z-index: 2;
}
.iai-visual-strip figcaption strong {
  display: block;
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}
.iai-visual-strip figcaption span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Contact aside photo treatment */
.iai-contact-photo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 2rem;
  isolation: isolate;
}
.iai-contact-photo img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.iai-contact-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,79,108,0.0) 50%, rgba(11,79,108,0.55) 100%);
  pointer-events: none;
}
