@layer page {
  /* the page background is blue by default.
   * when we overscroll the stuck header, the top edge looks really hard
   * as it's transitioning back to white. so just transition the page
   * background alongside it.
   */
  :root:has(header.transitions-colors) {
    background-color: var(--dark-blue-docs-site);

    transition: background-color 0.2s;
    background-color: var(--dark-blue-docs-site);

    &:has(header.stuck) {
      background-color: var(--white-docs-site);
    }
  }

  body {
    background-color: var(--appian-background-docs-site);
    display: flex;
    flex-direction: column;
  }

  main {
    flex: 1;
  }
  
  .homepage-banner {
    align-items: center;
    background-color: var(--pale-blue-docs-site);
    text-align: center;
    padding: 0.5rem 2rem;
    border: 0.5px solid var(--appian-blue-docs-site);
    border-radius: 0.5rem;
    max-width: 65%;
    width: max-content;
    margin: auto;
  }

  .homepage-banner .page-banner-left {
    display: inline-block;
    text-align: left;
  }

  .homepage-banner a {
    color: var(--appian-blue-docs-site);
    text-decoration: underline;
  }

  .splash {
    /* shift it under the transparent header */
    margin-top: calc(-1 * var(--page-header-height));
    padding-top: var(--page-header-height);
    background-color: var(--dark-blue-docs-site);
    color: var(--white-docs-site);
    background-image: url("/suite/help/26.10/images/modernize/splash\ background.svg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
  }

  .splash-content {
    padding: 2.5rem var(--page-h-padding) 2.5rem var(--page-h-padding);
    text-align: center;
  }

  .splash-content h2,
  .splash-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .pagewidth,
  footer > .container {
    max-width: var(--page-max-width);
    margin: auto;
  }

  .splash-controls {
    display: flex;
    position: relative;
    align-items: center;
    gap: 0.9375rem;
    max-width: 45.0625rem;
    height: 3rem;
    margin-top: 1.0625rem;
    margin-left: auto;
    margin-right: auto;
  }

  .splash-controls .search-button {
    right: 2.5rem;
  }

  @media (width < 56.5rem) {
    .splash-controls .search-button {
      right: 0.35rem;
    }
  }

  .splash input[type="text"] {
    padding-left: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;

    &::placeholder {
      color: var(--gray-dark-docs-site);
    }
  }

  #splash-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  @media (width < 56.5rem) {
    #splash-info-icon {
      display: none;
    }
  }

  main .sections {
    display: flex;
    flex-direction: column;
    padding: 3.125rem var(--page-h-padding);
    gap: 3.125rem;
  }

  section h2 {
    margin-bottom: 1.875rem;
  }

  .build .cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(16rem, 30rem));
    gap: var(--page-std-gap);
    flex-wrap: wrap;
    justify-content: center;
  }

  .build .cards[data-card-count="4"] {
    grid-template-columns: repeat(4, minmax(16rem, 20.8125rem));
  }

  .build .card,
  .explore .card {
    background-repeat: no-repeat;
    background-position-x: center;
  }

  .build .card {
    width: 100%;
    min-height: 20.8125rem;
    padding-bottom: 1.25rem;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.625rem;
  }

  @media (width < 65rem) {
    .build .cards {
      grid-template-columns: repeat(2, 1fr);
      grid-auto-flow: row;
    }
  }

  @media (width < 82.5rem) {
    .build .cards[data-card-count="4"] {
      grid-template-columns: repeat(2, 1fr);
      grid-auto-flow: row;
    }
  }

  @media (width < 44.5rem) {
    .build .cards {
      grid-template-columns: 1fr;
    }
  }

  .build .card ul:has(li:nth-child(5)) {
    display: block;
    column-count: 2;
  }

  .build .card img {
    align-self: end;
    justify-self: center;
    margin-top: 0.4375rem;
    margin-bottom: 1rem;
  }

  .explore .cards {
    display: flex;
    flex-direction: column;
    gap: var(--page-std-gap);
  }

  .explore .card {
    display: grid;
    grid-template:
      "heading image" auto
      "links image" 1fr / auto 1fr;
    overflow-x: hidden;
  }

  @media (width >= 36rem) {
    .explore .card {
      &:nth-of-type(4n),
      &:nth-of-type(4n + 1) {
        ul {
          width: 26.25rem;
          column-count: 2;
        }
      }
      
      img {
        width: 200px;
        height: 170px;
      }
    }
  }

  .explore .card ul {
    display: block;
    column-fill: auto;
    column-gap: 1.25rem;
    grid-area: links;
  }

  @media (width >= 36rem) {
    .explore .card ul {
      width: 12.5rem;
      max-height: 11.875rem;
    }
  }

  .explore .card img {
    grid-area: image;
    align-self: center;
    justify-self: end;
  }

  .explore .card h3 {
    grid-area: heading;
  }

  @media (width >= 56.5rem) {
    .explore .cards {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      grid-auto-rows: 18.75rem;
    }

    .explore .card {
      grid-column: span 3;

      &:nth-of-type(4n),
      &:nth-of-type(4n + 1) {
        grid-column: span 5;
      }
    }
  }

  /* between 56.5rem and 82.5rem, or below 49rem, hide card images */
  @media ((width >= 56.5rem) and (width < 82.5rem)) or (width < 49rem) {
    .explore .card {
      grid-template:
        "heading" auto
        "links" 1fr / 1fr;

      img {
        display: none;
      }
    }
  }

  .explore .card ul li:not(:last-of-type) {
    margin-bottom: 0.3125rem;
  }

  .build-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 1.875rem;
    flex-wrap: wrap;
    column-gap: 3rem;
    row-gap: 0.625rem;
  }

  .build-heading h2 {
    margin-bottom: 0;
  }

  a:not(:hover) {
    text-decoration: none;
  }

  .release-notes-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3.5rem;
    flex-wrap: nowrap;
  }

  .release-notes-text {
    font-weight: bold;
    color: var(--white-docs-site);
  }

  .release-notes-button {
    background-color: var(--appian-blue-docs-site);
    color: var(--white-docs-site);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 400;
    transition: background-color 0.2s;
    white-space: nowrap;
  }

  /* Set splash tooltip to float left when screen reaches small size */
  @media (width <= 65rem) {
    #tooltip-splash-info-icon {
      right: -0.35rem;
      left: unset !important;
      transform: unset !important;
    }
    #tooltip-splash-info-icon::after {
        left: auto !important;
        right: 0;
    }
  }

  /* Ask AI button below release notes on homepage */
  .splash-ai-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
  }

  .splash-ai-button-wrapper .ai-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 170px;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    background-color: transparent;
    color: var(--white-docs-site);
    border: 1px solid var(--white-docs-site);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    z-index: 0;
    animation: ai-button-border-hide 30s ease infinite;
  }

  .splash-ai-button-wrapper .ai-button svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
  }

  .splash-ai-button-wrapper .ai-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    padding: 2px;
    background: conic-gradient(from var(--ai-glow-angle), transparent 0%, var(--white-docs-site) 10%, transparent 20%);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    animation: ai-glow-spin 3.5s linear infinite, ai-glow-pulse 30s ease infinite;
    z-index: -1;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .splash-ai-button-wrapper .ai-button::before {
      animation: none;
    }
    .splash-ai-button-wrapper .ai-button {
      animation: none;
    }
  }
} 
