/*gradient mesh effect adapted from https://github.com/baunov/gradients-bg*/

/*Grain effect adapted from codePen by Ooblek
Copyright (c) 2024 by Ooblek (https://codepen.io/ooblek/pen/vYxYomx)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/*also the background gradient keyframes are loosely adapted from gradient-animator.com, just in case I need to find that again*/

:root {
    --color-bg1: rgb(97, 69, 255);
    --color-bg2: rgb(243, 126, 218);
    --color-bg3: rgb(121, 247, 188);
    --color1: 0, 0, 255;
    --color2: 70, 204, 255;
    --color3: 241, 72, 250;
    --color4: 153, 247, 180;
    --color5: 241, 72, 206;
    --color-interactive: 153, 241, 194;
    --circle-size: 800px;
    --blending: color-dodge;
  }

  @media screen and (max-width: 400px) {
  :root{
    --circle-size: 300px;
  }    
  }
  
  @keyframes moveInCircle {
    0% {
      transform: rotate(0deg);
    }
    50% {
      transform: rotate(180deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  @keyframes moveVertical {
    0% {
      transform: translateX(-2%) translateY(-80%);
    }
    25% {
      transform: translateX(-50%) translateY(20%);
    }
    50% {
      transform: translateX(-20%) translateY(70%)
    }
    75% {
      transform: translateX(-10%) translateY(50%)
    }
    100% {
      transform: translateX(-2%) translateY(-80%);
    }
  }
  
  @keyframes moveHorizontal {
    0% {
      transform: translateX(-50%) translateY(-10%);
    }
    50% {
      transform: translateX(70%) translateY(10%);
    }
    100% {
      transform: translateX(-50%) translateY(-10%);
    }
  }

  /*
  hey future me
  this squish animation seems to increase paint times
  it's not a prob right now, but if things get chunky, this one might be the one to go
  ok that's all bye
  */
  @keyframes squish {
    0% {
        height: calc(var(--circle-size)/2);
        width: calc(var(--circle-size)*1.8)
    }
    50% {
        height: calc(var(--circle-size)*1.2);
        width: calc(var(--circle-size)/1.3);
    }
    100% {
        height: calc(var(--circle-size)/2);
        width: calc(var(--circle-size)*1.8)
    }
  }

  @keyframes backgroundGradient {
    0%{background-position:0% 50%}

    50%{background-position: 100% 50%}

    100%{background-position:0% 50%;}
  }
  
  @keyframes animateGrain{
    0%, 100% { transform:translate(0, 0) }
    10%{
      transform:translate(-5%,-10%)
    }
    20%{
      transform:translate(-15%,-20%)
    }
    30%{
      transform:translate(-5%,-10%)
    }
    40%{
      transform:translate(-15%,-20%)
    }
    
    50%{
      transform:translate(-5%,-10%)
    }
    60%{
      transform:translate(-15%,-20%)
    }
    70%{
      transform:translate(-5%,-10%)
    }
    80%{
      transform:translate(-15%,-20%)
    }
    90%{
      transform:translate(-5%,-10%)
    }
    100%{
      transform:translate(-15%,-20%)
    }
  }

  @keyframes fadein {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
  
  #herosection {
    opacity: 0;
    width: 90vw;
    height: 90vh;
    margin: 5vh 5vw 5vh 5vw;
    position: relative;
    overflow: hidden;
    background: linear-gradient(240deg, var(--color-bg2), var(--color-bg1), var(--color-bg3));
    background-size: 400%;
    top: 0;
    left: 0;
    box-shadow: 5px 5px 15px rgb(155, 155, 155);

    animation: fadein 2s ease 1s, backgroundGradient 50s linear infinite;
    animation-fill-mode: forwards;
  }

  @media screen and (max-width: 800px) {
    #herosection{
      height: 70vh;
    }    
  }


  /*
  grain effect only on larger screens bc it seems to freak out on mobile sometimes
  not always
  not sure what's going on there
  looks fine w/o at that scale tho
  */
  @media screen and (min-width: 400px) {
    #herosection:after{
      content:"";
      background-image:url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Dissolve_Noise_Texture.png");
      height: 300%;
      width: 300%;
      position: absolute;
      top: -100%;
      opacity:0.03;
      animation: animateGrain 8s steps(10) infinite;
    } 
  }
  

  /*changed this to fix the weird svg render issue in Firefox*/
    svg {
      /*display: none;*/
      position: absolute;
      height: 0;
    }
  
  
    .gradients-container {
      filter: url(#goo) blur(30px);
      width: 100%;
      height: 100%;
    }
  
    .g1 {
      position: absolute;
      background: radial-gradient(rgba(var(--color1), 0.5) 0, rgba(var(--color1), 0) 90%) no-repeat;
      mix-blend-mode: var(--blending);
      top: calc(50% - var(--circle-size) / 3);
      left: calc(50% - var(--circle-size) / 2);
  
      transform-origin: center center;
      animation: moveVertical 51s ease infinite, squish 15s ease infinite;
  
      opacity: 1;
    }
  
    .g2 {
      position: absolute;
      background: radial-gradient(rgba(var(--color2), 0.5) 0, rgba(var(--color2), 0) 90%) no-repeat;
      mix-blend-mode: var(--blending);
      top: calc(50% - var(--circle-size) / 2);
      left: calc(50% - var(--circle-size) / 2);
  
      transform-origin: calc(50% - 400px);
      animation: moveInCircle 54s reverse infinite, squish 32s ease infinite;
  
      opacity: 1;
    }
  
    .g3 {
      position: absolute;
      background: radial-gradient(rgba(var(--color3), 0.5) 0, rgba(var(--color3), 0) 90%) no-repeat;
      mix-blend-mode: var(--blending);
      top: calc(50% - var(--circle-size) / 2 + 200px);
      left: calc(50% - var(--circle-size) / 2 - 500px);
  
      transform-origin: calc(50% + 400px);
      animation: moveInCircle 45s linear infinite, squish 24s ease infinite;
  
      opacity: 1;
    }
  
    .g4 {
      position: absolute;
      background: radial-gradient(rgba(var(--color4), 0.5) 0, rgba(var(--color4), 0) 90%) no-repeat;
      mix-blend-mode: var(--blending);
      top: calc(50% - var(--circle-size) / 2);
      left: calc(50% - var(--circle-size) / 2);
  
      transform-origin: calc(50% - 200px);
      animation: moveHorizontal 59s ease infinite, squish 50s ease infinite;
  
      opacity: 0.7;
    }
  
    .g5 {
      position: absolute;
      background: radial-gradient(rgba(var(--color5), 0.5) 0, rgba(var(--color5), 0) 90%) no-repeat;
      mix-blend-mode: var(--blending);
      top: calc(50% - var(--circle-size));
      left: calc(50% - var(--circle-size));
  
      transform-origin: calc(50% - 800px) calc(50% + 200px);
      animation: moveInCircle 69s ease infinite, squish 40s ease infinite;
  
      opacity: 1;
    }
  
    #interactive {
      position: absolute;
      background: radial-gradient(circle, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 70%) no-repeat;
      mix-blend-mode: screen;
  
      width: 100%;
      height: 100%;

      top: -50%;
      left: -50%;
  
      opacity: 0.4;
    }
  
    @media screen and (max-width: 400px) {
      #interactive {
        background: radial-gradient(circle, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 90%) no-repeat;

      }
    }