.hai {
  --hai-color-navy: #001B5B;
  --hai-color-light-blue: #0078E3;
  --hai-color-gray: #6f706d;
  --hai-color-rule: #E8EEF4;
  --hai-font-title: 'TT Firs Neue', sans-serif;
  --hai-font-body: 'Space Grotesk', sans-serif;
  /* Side padding of the text block and the footer; shrinks on smaller screens. */
  --hai-pad-x: 24px;

  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff;
  padding: 80px 24px;
}

.hai *,
.hai *::before,
.hai *::after { box-sizing: border-box; }

/* Decorative pale-blue shape peeking from the top-left, behind the content */
.hai__deco {
  position: absolute;
  top: 0;
  left: 0;
  width: 226px;
  height: auto;
  z-index: 0;
  pointer-events: none;
}

.hai__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.hai__title {
  margin: 0 0 73px !important;
  font-family: var(--hai-font-title);
  font-size: 48px !important;
  line-height: 1.15;
  font-weight: 500;
  color: var(--hai-color-navy);
}

.hai__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.hai__col {
  display: flex;
  flex-direction: column;
}

.hai__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 96px;
  padding: 0 var(--hai-pad-x);
  margin-bottom: 10px;
}

.hai__agent-title {
  margin: 0;
  font-family: var(--hai-font-title);
  font-size: 24px !important;
  font-weight: 500;
  margin-bottom: 0 !important;
  color: var(--hai-color-navy);
}

.hai__desc {
  margin: 0;
  font-family: var(--hai-font-body);
  font-size: 18px !important;
  line-height: 1.55;
  color: var(--hai-color-navy);
  margin-bottom: 0 !important;
}

/* Rule + link, pinned to the bottom so the three cards line up. */
.hai__foot {
  margin-top: auto;
  margin-bottom: 25px;
  padding: 0 var(--hai-pad-x);
}

.hai__rule {
  height: 1px;
  background-color: var(--hai-color-rule);
  margin: 0 0 16px;
}

.hai__link {
  display: inline-block;
  font-family: var(--hai-font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--hai-color-light-blue);
  text-decoration: none;
  transition: opacity 0.2s;
}

.hai__link:hover { opacity: 0.8; }

.hai__arrow { display: inline-block; transition: transform 0.2s; }
.hai__link:hover .hai__arrow { transform: translateX(3px); }

/* ── Video card ── */

.hai__media {
  position: relative;
  width: 100%;
  aspect-ratio: 7 / 8;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--hai-color-navy);
}

/* Card without a link: no footer to absorb the slack, so the media takes over. */
.hai__text + .hai__media { margin-top: auto; }

.hai__media--has-poster {
  background-image: var(--hai-poster);
  background-size: cover;
  background-position: center;
}

.hai__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Subtle tint so the video/poster sits back a little. */
.hai__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(6, 12, 29, 0.12);
  pointer-events: none;
}

@media (max-width: 1024px) {
  .hai {
    padding: 64px 24px;
    --hai-pad-x: 16px;
  }
  .hai__grid { gap: 24px; }
  .hai__title { margin-bottom: 40px !important; }
  .hai__agent-title { font-size: 22px !important; }
  .hai__desc { font-size: 17px !important; }
}

@media (max-width: 768px) {
  .hai {
    padding: 48px 20px;
    --hai-pad-x: 0px;
  }
  .hai__grid { grid-template-columns: 1fr; gap: 36px; }
  .hai__title {
    font-size: 2.25rem !important;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px !important;
    text-align: left;
  }
  .hai__text { min-height: 0; }
  .hai__agent-title { font-size: 20px !important; }
  .hai__desc { font-size: 16px !important; }
  .hai__link { font-size: 15px; }
  .hai__deco { display: none; }

  /* Drop video on mobile only when the toggle is off: poster background stands in */
  .hai:not(.hai--mobile-video) .hai__video { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hai__video { display: none; }
}

/* ── Optional header subtitle and alignment ── */

.hai--has-intro .hai__title { margin-bottom: 20px !important; }

.hai__intro {
  margin: 0 0 73px !important;
  font-family: var(--hai-font-body);
  font-size: 18px !important;
  line-height: 1.55;
  color: var(--hai-color-navy);
}

/* ── Card layout: title, tagline, divider, description ── */

.hai__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 var(--hai-pad-x);
}

.hai__tagline {
  margin: 0 !important;
  font-family: var(--hai-font-body);
  font-size: 20px !important;
  line-height: 1.35;
  color: var(--hai-color-light-blue);
}

.hai__body {
  margin-bottom: 25px;
  padding: 0 var(--hai-pad-x);
}

.hai__body .hai__rule { margin-bottom: 24px; }
.hai__body .hai__link { margin-top: 16px; }

/* Without subgrid the columns stay flex: the media still lines up at the bottom. */
.hai__body + .hai__media { margin-top: auto; }

@media (min-width: 769px) {
  .hai--center .hai__title,
  .hai--center .hai__intro { text-align: center; }
  /* A centered header reads as one long line, so it runs smaller than the 48px default. */
  .hai--center .hai__title { font-size: 40px !important; }

  /* Shared rows, so a two-line tagline moves every divider and description with it. */
  @supports (grid-template-rows: subgrid) {
    .hai--tagline .hai__grid { row-gap: 0; }
    .hai--tagline .hai__col {
      display: grid;
      grid-row: span 3;
      grid-template-rows: subgrid;
    }
    .hai--tagline .hai__col:nth-child(n+4) { margin-top: 36px; }
  }
}

@media (max-width: 1024px) {
  .hai__intro { margin-bottom: 40px !important; }
  .hai__tagline { font-size: 18px !important; }
}

@media (max-width: 768px) {
  .hai--has-intro .hai__title { margin-bottom: 12px !important; }
  .hai__intro {
    margin-bottom: 32px !important;
    font-size: 16px !important;
  }
}
