/* === HERO === */

[id="ai-hero"] {
  padding: 2.5rem 0 5rem;

  & .main-title {
    margin-bottom: 1.5rem;
  }

  & p {
    color: var(--dark-blue);
    line-height: 1.6;
    max-width: 60ch;
  }
}

/* the shared breadcrumb greys fall below 4.5:1 on lilac */
[id="ai-hero"] .breadcrumb span,
[id="ai-hero"] .breadcrumb [aria-current="page"] {
  color: var(--dark-blue);
}

.ai-hero-inner {
  display: grid;
  /* wide enough for the title to sit on one line */
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;

  & figure {
    margin: 0;
    justify-self: center;
  }

  & img {
    width: min(380px, 100%);
  }

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;

    & figure {
      order: -1;
    }

    & img {
      width: min(240px, 100%);
    }
  }
}

.ai-lead {
  font-size: 1.375rem;
  font-weight: var(--medium);
  color: var(--burgundy) !important;
}

.ai-ctas {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
}


/* === SERVICES === */

[id="ai-services"] {
  padding: 5rem 0;

  & h2 {
    color: var(--off-white);
  }
}

.ai-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;

  @media not (min-width: 1000px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media not (min-width: 650px) {
    grid-template-columns: 1fr;
  }
}

.ai-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--cream);

  & img {
    width: 56px;
    height: 56px;
    margin-bottom: 0.5rem;
  }

  & h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: var(--medium);
    color: var(--burgundy);
  }

  & p {
    margin: 0;
    line-height: 1.6;
    color: var(--dark-blue);
  }
}


/* === WHAT WE BUILD === */

[id="ai-build"] {
  padding: 5rem 0;

  & h2 {
    margin-bottom: 2rem;
  }

  & .snake h3 {
    font-size: 1.5em;
    font-weight: var(--medium);
    color: var(--burgundy);
    margin-bottom: 0.5em;
  }

  & .snake p {
    color: var(--dark-blue);
    line-height: 1.6;
    max-width: 60ch;
  }

  & .snake img {
    max-height: 200px;
  }
}


/* === VALIDATION TIMELINE === */

[id="ai-validation"] {
  padding: 5rem 0 6rem;

  & h2,
  & h3,
  & p {
    color: var(--off-white);
  }

  & a {
    color: var(--lilac);
  }
}

[id="ai-validation"] h2 {
  margin-bottom: 2rem;
}

.trust-intro p {
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 70ch;
}

/* === SECTORS === */

[id="sectors"] {
  padding: 5rem 0;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* same gap as the other three-column grids so the columns line up */
  gap: 1.5rem;
  margin-top: 2rem;

  @media not (min-width: 1000px) {
    grid-template-columns: 1fr;
  }

  & h3 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    color: var(--burgundy);
    font-weight: var(--medium);
  }

  & p {
    color: var(--dark-blue);
    line-height: 1.6;
  }
}


/* === TECHNOLOGY PARTNERS === */

[id="ai-partners"] {
  padding: 3.5rem 0 4rem;

  & h2 {
    margin: 0 0 2rem;
    color: var(--burgundy);
  }
}

.partner-logos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;

  @media not (min-width: 700px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2.5rem;
  }

  & li {
    display: flex;
    justify-content: center;
    max-width: none;
    margin: 0;
  }

  & img {
    height: var(--logo-h, 56px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
  }
}


/* === TRAINING === */

[id="train-your-team"] {
  padding: 5rem 0;
}

.train-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: start;

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  & p {
    color: var(--dark-blue);
    line-height: 1.6;
  }
}

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--light-brown);

  & li {
    max-width: none;
    margin: 0;
    border-bottom: 1px solid var(--light-brown);
  }

  & a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 0.5rem;
    color: var(--dark-blue);
    text-decoration: none;
  }

  & a::after {
    content: none;
  }

  & strong {
    display: block;
    font-size: 1.1rem;
    font-weight: var(--medium);
    color: var(--burgundy);
    margin-bottom: 0.25rem;
  }

  & i {
    color: var(--burgundy);
    transition: transform 0.2s;
  }

  & a:hover,
  & a:focus-visible {
    background: var(--off-white);

    & strong {
      text-decoration: underline;
    }

    & i {
      transform: translateX(4px);
    }
  }
}


/* === WHY JR === */

[id="why-jr"] {
  padding: 5rem 0;
}

.why-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: center;

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.why-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  & li {
    position: relative;
    max-width: 65ch;
    padding-left: 1.75rem;
    color: var(--dark-blue);
    line-height: 1.6;
  }

  /* same chevron as the site's accordions */
  & li::before {
    content: '›';
    position: absolute;
    left: 0;
    top: -0.35rem;
    font-size: 2rem;
    font-weight: var(--semi-bold);
    line-height: 1;
    color: var(--coral);
  }

  & strong {
    color: var(--burgundy);
  }
}

.why-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;

  & img {
    height: 110px;
    width: auto;
  }

  /* the CCS mark is a wide landscape logo, so size it by width */
  & .why-ccs {
    height: auto;
    width: min(260px, 100%);
  }

  @media not (min-width: 900px) {
    justify-content: flex-start;

    & img {
      height: 80px;
    }
  }
}

/* === AI IN PRODUCTION === */

[id="aip"] {
  padding: 5rem 0;

  & h2,
  & p,
  & li {
    color: var(--off-white);
  }

  & p {
    max-width: 55ch;
    line-height: 1.6;
  }
}

/* same split as the training section above, so the two line up */
.aip-inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: start;

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* heading top lines up with the facts list, as in the training section */
  & h2 {
    margin-top: 0;
  }
}

.aip-logo {
  display: block;
  width: min(150px, 50%);
  height: auto;
  margin-bottom: 1.5rem;
}

.buttony-link.aip-button {
  color: var(--dark-blue);
  background-color: var(--lilac);
  border-color: var(--lilac);
}

.aip-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;

  & li {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.5rem;
    background: rgb(255 255 255 / 0.06);
    line-height: 1.5;
  }

  & strong {
    display: block;
    font-size: 1.1rem;
    font-weight: var(--medium);
  }
}


/* === CTA BAND === */

[id="ai-cta"] {
  padding: 4rem 0;
}

.ai-cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;

  & h2 {
    margin: 0 0 0.75rem;
    color: var(--burgundy);
  }

  & p {
    margin: 0;
    max-width: 60ch;
    color: var(--dark-blue);
    line-height: 1.6;
  }

  & .buttony-link {
    margin: 0;
    flex-shrink: 0;
  }

  @media not (min-width: 800px) {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* === CASE STUDY TITLES === */

[id="evidence"] {
  /* follows the cream Why JR section, so no top padding; bottom matches other sections */
  padding: 0 0 5rem;

  & h2 {
    margin-bottom: 2rem;
  }

  & .case-study-grid {
    gap: 1.5rem;
    margin-top: 0;
  }

  & .case-study-item {
    padding: 1.5rem;
  }

  & .case-study-item .buttony-link {
    font-size: 0.9rem;
  }
}

.case-study-title {
  width: 100%;
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: var(--medium);
  line-height: 1.4;
  text-align: center;
  color: var(--burgundy);
}


/* === TRUSTED BY STRIP === */

[id="ai-logos"] {
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}

.ai-logos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;

  & h2 {
    margin: 0;
    color: var(--burgundy);
  }
}

button.logo-marquee-toggle {
  padding: 0.25rem 1rem;
  font: inherit;
  color: var(--burgundy);
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
}

.logo-marquee {
  display: flex;
  width: 100%;
  /* the mask isolates this box, so the logos' multiply blend needs a backdrop
     inside it to hide their white backgrounds */
  background: var(--off-white);
  /* fade the logos in and out at the edges */
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.logo-track {
  display: flex;
  flex-shrink: 0;
  gap: 3rem;
  margin: 0;
  padding: 0 3rem 0 0;
  list-style: none;

  & li {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    max-width: none;
    margin: 0;
    padding: 0.5rem;
  }

  & img {
    max-width: 100%;
    max-height: 100%;
    /* some logo files have a white background; blend it into the page */
    mix-blend-mode: multiply;
  }
}

/* only animate once JavaScript has set up the pause button; without it the logos sit still */
@media (prefers-reduced-motion: no-preference) {
  .logo-marquee.is-ready .logo-track {
    animation: logo-scroll 110s linear infinite;
  }
}

.logo-marquee:not(.is-ready) {
  mask-image: none;

  & .logo-track {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
  }

  & .logo-track[aria-hidden="true"] {
    display: none;
  }
}

.logo-marquee:hover .logo-track,
.logo-marquee:focus-within .logo-track,
.logo-marquee.is-paused .logo-track {
  animation-play-state: paused;
}

@keyframes logo-scroll {
  to {
    transform: translateX(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee {
    mask-image: none;
  }

  .logo-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
  }

  .logo-track[aria-hidden="true"],
  button.logo-marquee-toggle {
    display: none;
  }
}


/* === WEBINARS === */

[id="ai-webinars"] {
  padding: 5rem 0;

  & h2,
  & p,
  & figcaption {
    color: var(--off-white);
  }

  & p {
    line-height: 1.6;
  }
}

.webinar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;

  & h2 {
    margin-top: 0;
  }

  & .buttony-link {
    flex-shrink: 0;
    margin: 0;
  }

  @media not (min-width: 800px) {
    flex-direction: column;
    gap: 0;
  }
}

.webinar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;

  @media not (min-width: 1000px) {
    grid-template-columns: 1fr;
    max-width: 640px;
  }
}

.webinar {
  margin: 0;

  & figcaption {
    margin-top: 0.75rem;
    font-size: 1.2rem;
    font-weight: var(--medium);
    line-height: 1.4;
  }
}

.webinar-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  /* shows behind the thumbnail if it fails to load */
  background: var(--dark-blue);

  & img,
  & iframe {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
  }
}

a.webinar-frame::after {
  content: none;
}

.webinar-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 4.5rem;
  height: 3.25rem;
  transform: translate(-50%, -50%);
  background: var(--coral);
  transition: background-color 0.2s;

  &::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.7rem 0 0.7rem 1.2rem;
    border-color: transparent transparent transparent var(--off-white);
  }
}

a.webinar-frame:hover .webinar-play,
a.webinar-frame:focus-visible .webinar-play {
  background: var(--lilac);

  &::before {
    border-left-color: var(--burgundy);
  }
}

a.webinar-frame:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 3px;
}

.buttony-link.webinar-button {
  color: var(--dark-blue);
  background-color: var(--lilac);
  border-color: var(--lilac);
}


/* === BLOG === */

[id="ai-blog"] {
  padding: 5rem 0;

  & .blog-head {
    align-items: center;
    margin-bottom: 2rem;
  }

  & .blog-head h2 {
    margin: 0;
  }

  & .blog-card {
    padding: 1.5rem;
  }

  & .blog-card-title {
    font-size: 1.2rem;
  }

  & .blog-card-excerpt {
    font-size: 1rem;
  }

  & .blog-card-meta {
    font-size: 0.85rem;
  }

  & .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;

    @media not (min-width: 1000px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media not (min-width: 650px) {
      grid-template-columns: 1fr;
    }
  }
}
