/* Selected Case Highlights final section-level phone adjustment.
   Move the complete section—from its heading through Back to top—up 5px
   without altering any approved internal spacing. */
@media (max-width:760px){
  body.portfolio-page .portfolio-featured-refresh{
    position:relative!important;
    top:-5px!important;
    margin-bottom:-5px!important;
  }

  /* Phone-only Selected Case Study Highlights calibration. */
  body.portfolio-page #transformation-highlights{
    scroll-margin-top:-3px!important;
  }

  body.portfolio-page .portfolio-featured-sidebar .portfolio-full-jump{
    position:relative!important;
    top:-8px!important;
  }

  /* Raise the cards and both following navigation links by the same 12px,
     preserving their already-approved spacing relative to one another. */
  body.portfolio-page .portfolio-featured-refresh .portfolio-highlight-shell{
    transform:translateY(-52px)!important;
  }

  body.portfolio-page .portfolio-featured-refresh .portfolio-applied-jump-wrap{
    transform:translateY(-22px)!important;
  }

  body.portfolio-page .portfolio-featured-refresh > .portfolio-transition-back-top{
    transform:translateY(-12px)!important;
  }

  /* The See Full Portfolio link targets the existing heading anchor so the
     heading clears the fixed phone header without moving the section itself. */
  body.portfolio-page #complete-portfolio{
    scroll-margin-top:52px!important;
  }

  /* Move only the utility link beneath Complete Portfolio down 3px. */
  body.portfolio-page .portfolio-complete-transition .portfolio-transition-back-link{
    position:relative!important;
    top:3px!important;
  }
}

/* Desktop-only Applied Technology framing. The section anchor and the
   established Sudoku composition remain unchanged. */
@media (min-width:761px){
  body.portfolio-page .portfolio-featured-refresh > .portfolio-transition-back-top{
    transform:translateY(-15px)!important;
  }

  body.portfolio-page section#applied-technology.portfolio-sudoku-section{
    position:relative!important;
    isolation:isolate;
    overflow:hidden;
    padding-top:12px!important;
    padding-bottom:12px!important;
  }

  body.portfolio-page section#applied-technology.portfolio-sudoku-section::before,
  body.portfolio-page section#applied-technology.portfolio-sudoku-section::after{
    content:"";
    position:absolute;
    left:0;
    z-index:2;
    width:100%;
    height:5px;
    pointer-events:none;
    background-repeat:repeat-x;
  }

  body.portfolio-page section#applied-technology.portfolio-sudoku-section::before{
    top:0;
    background-image:linear-gradient(90deg,
      transparent 0%,
      transparent 9%,
      rgba(215,165,54,.22) 13%,
      rgba(215,165,54,.88) 22%,
      rgba(54,145,205,.78) 36%,
      rgba(54,145,205,.18) 48%,
      transparent 55%,
      transparent 100%);
    background-size:210% 100%;
    animation:portfolioAppliedLineTop 7.2s linear infinite;
  }

  body.portfolio-page section#applied-technology.portfolio-sudoku-section::after{
    bottom:0;
    background-image:linear-gradient(90deg,
      transparent 0%,
      transparent 18%,
      rgba(54,145,205,.18) 24%,
      rgba(54,145,205,.76) 37%,
      rgba(215,165,54,.84) 51%,
      rgba(215,165,54,.20) 61%,
      transparent 68%,
      transparent 100%);
    background-size:235% 100%;
    animation:portfolioAppliedLineBottom 8.4s linear infinite;
  }
}

@keyframes portfolioAppliedLineTop{
  from{background-position:110% 0;}
  to{background-position:-110% 0;}
}

@keyframes portfolioAppliedLineBottom{
  from{background-position:-120% 0;}
  to{background-position:120% 0;}
}

@media (min-width:761px) and (prefers-reduced-motion:reduce){
  body.portfolio-page section#applied-technology.portfolio-sudoku-section::before,
  body.portfolio-page section#applied-technology.portfolio-sudoku-section::after{
    animation:none!important;
    background-position:center;
  }
}
