a#btn_botanicalgarden {
    display: inline-block;
    position: relative;
    width: 160px;
    height: 160px;
    background: url("https://www.missouribotanicalgarden.org/Portals/0/2022redesignassets/MBG/mobot-header-logo.svg") no-repeat center;
    background-size: contain;
    margin-top: 60px;
    transition: transform 0.4s ease;
}

:root {
    --leaf-url: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA4MCI+PHBhdGggZD0iTTIwIDFDNSAyMCA1IDYwIDIwIDc5QzM1IDYwIDM1IDIwIDIwIDFaIiBmaWxsPSIjNWZiOTZjIiBzdHJva2U9IiMyZjZiM2IiIHN0cm9rZS13aWR0aD0iMiIvPjxwYXRoIGQ9Ik0yMCA2TDIwIDc0IiBzdHJva2U9IiMyZjZiM2IiIHN0cm9rZS13aWR0aD0iMS41Ii8+PC9zdmc+");
}

a#btn_botanicalgarden::before,
a#btn_botanicalgarden::after{
    content: "";
    position: absolute;
    width: 100px;
    height: 28px;
    background-image: var(--leaf-url);
    background-repeat: no-repeat;
    background-size: 240% 100%;
    background-position: center top;
    opacity: 0;
    transform-origin: top center;
    will-change: transform, opacity;
}

a#btn_botanicalgarden::before {
    left: 0px;
    top: -10px;
}

a#btn_botanicalgarden::after {
    right: 16px;
    top: -12px;
}

@keyframes driftLeft {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    10% {
        transform: translate(-8px, 22px) rotate(8deg);
        opacity: 0.95;
    }

    20% {
        transform: translate(-16px, 48px) rotate(-6deg);
    }

    30% {
        transform: translate(-24px, 78px) rotate(10deg);
    }

    40% {
        transform: translate(-32px, 112px) rotate(-8deg);
        opacity: 0.85;
    }

    50% {
        transform: translate(-40px, 148px) rotate(12deg);
    }

    60% {
        transform: translate(-36px, 184px) rotate(-10deg);
        opacity: 0.7;
    }

    70% {
        transform: translate(-28px, 220px) rotate(8deg);
    }

    80% {
        transform: translate(-20px, 256px) rotate(-6deg);
        opacity: 0.5;
    }

    90% {
        transform: translate(-12px, 292px) rotate(6deg);
    }

    100% {
        transform: translate(-6px, 340px) rotate(-4deg);
        opacity: 0;
    }
}

@keyframes driftRight {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    10% {
        transform: translate(8px, 22px) rotate(-8deg);
        opacity: 0.95;
    }

    20% {
        transform: translate(16px, 48px) rotate(6deg);
    }

    30% {
        transform: translate(24px, 78px) rotate(-10deg);
    }

    40% {
        transform: translate(32px, 112px) rotate(8deg);
        opacity: 0.85;
    }

    50% {
        transform: translate(40px, 148px) rotate(-12deg);
    }

    60% {
        transform: translate(36px, 184px) rotate(10deg);
        opacity: 0.7;
    }

    70% {
        transform: translate(28px, 220px) rotate(-8deg);
    }

    80% {
        transform: translate(20px, 256px) rotate(6deg);
        opacity: 0.5;
    }

    90% {
        transform: translate(12px, 292px) rotate(-6deg);
    }

    100% {
        transform: translate(6px, 340px) rotate(4deg);
        opacity: 0;
    }
}

a#btn_botanicalgarden:hover {
    transform: scale(1.15);
}

a#btn_botanicalgarden:hover::before {
    animation: driftLeft 6s linear forwards;
}

a#btn_botanicalgarden:hover::after {
    animation: driftRight 6.4s linear forwards 0.6s;
}

/* instagram button */
a#btn_instagram {
    position: relative;
    display: block;
    width: 100px;
    height: 100px;
    margin: 80px auto 0;
    background-color: #000;
    background-position: center;
    -webkit-mask: url('resources/instagram-alt-svgrepo-com.svg') center/contain no-repeat;
    mask: url('resources/instagram-alt-svgrepo-com.svg') center/contain no-repeat;
    transition: transform 0.4s ease;
    overflow: hidden;
}

/* gradient source: https://dev.to/dailydevtips1/css-logos-instagram-logo-1i96 */
a#btn_instagram::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle farthest-corner at 28% 100%,
            #fcdf8f 0%, #fbd377 10%, #fa8e37 22%, #f73344 35%, transparent 65%),
        linear-gradient(145deg, #3051f1 10%, #c92bb7 70%);
    opacity: 0;
    transition: opacity 0.8s ease;
    -webkit-mask: url('resources/instagram-alt-svgrepo-com.svg') center/contain no-repeat;
    mask: url('resources/instagram-alt-svgrepo-com.svg') center/contain no-repeat;
}

a#btn_instagram:hover::after {
    opacity: 1;
}

/* Nike Button*/
a#btn_nike {
    position: relative;
    display: block;
    width: 100%;
    height: 100px;
    top: 50%;
    transform: translateY(-50%);
    overflow: hidden;
    margin: 0;
}

a#btn_nike::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140px;
    height: 60px;
    background: #000;
    transform: translate(-50%, -50%);
    -webkit-mask: url('resources/Logo_NIKE.svg') center/contain no-repeat;
    mask: url('resources/Logo_NIKE.svg') center/contain no-repeat;
    opacity: 1;
    transition: opacity 0.25s ease;
}

a#btn_nike::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 140px;
    height: 60px;
    background: #000;
    transform: translateY(-50%) translateX(-160%);
    -webkit-mask: url('resources/Logo_NIKE.svg') center/contain no-repeat;
    mask: url('resources/Logo_NIKE.svg') center/contain no-repeat;
    opacity: 0;
}

a#btn_nike:hover::after {
    opacity: 0;
}

a#btn_nike:hover::before {
    opacity: 1;
    animation: swoosh-loop-fast 1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes swoosh-loop-fast {
    0% {
        transform: translateY(-50%) translateX(-160%);
        opacity: 1;
    }

    40% {
        transform: translateY(-50%) translateX(100%);
        opacity: 1;
    }

    60% {
        transform: translateY(-50%) translateX(160%);
        opacity: 0;
    }

    61% {
        transform: translateY(-50%) translateX(-160%);
        opacity: 0;
    }

    100% {
        transform: translateY(-50%) translateX(-160%);
        opacity: 1;
    }
}

/* Coca-Cola Button */
@font-face {
    font-family: 'Loki Cola';
    src: url('resources/LOKICOLA.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

a#btn_cocacola {
    display: block;
    position: relative;
    margin: 100px auto;
    font-family: 'Loki Cola';
    font-size: 60px;
    text-decoration: none;
    text-align: center;
    color: #E41A1C;
    overflow: hidden;
}

a#btn_cocacola::after {
    content: "1 oca Cola";
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 0;
    color: #E41A1C;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #E41A1C;
    opacity: 0;
}

a#btn_cocacola:hover {
    color: transparent;
    text-shadow: none;
}

a#btn_cocacola:hover::after {
    opacity: 1;
    animation: typeText 2s steps(18, end) forwards;
}

@keyframes typeText {
    0% {
        width: 0px;
        border-right-color: #E41A1C;
    }

    95% {
        width: 188px;
        border-right-color: #E41A1C;
    }

    100% {
        width: 188px;
        border-right-color: transparent;
    }
}

/* Cartoon Network Button */
a#btn_cartoonnetwork {
    display: block;
    position: relative;
    width: 160px;
    height: 160px;
    margin: 50px auto;
    background: url("resources/Cartoon_Network_2010_logo.svg") no-repeat center;
    background-size: contain;
    background-color: #ffffff;
}

@keyframes floatBounce {
    0% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-18px);
    }

    50% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(18px);
    }

    100% {
        transform: translateY(0);
    }
}

a#btn_cartoonnetwork:hover {
    animation: floatBounce 1.6s linear infinite;
}

/* Old Navy Button */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

a#btn_oldnavy {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: bold;
    font-size: 40px;
    color: #003a70;
    text-decoration: none;
    letter-spacing: 2px;
}

a#btn_oldnavy span {
    display: inline-block;
    transition: transform 0.3s ease;
}

a#btn_oldnavy:hover span {
    animation: wave 1.2s ease-in-out forwards;
}

a#btn_oldnavy:hover span:nth-child(1) {
    animation-delay: 0s;
}

a#btn_oldnavy:hover span:nth-child(2) {
    animation-delay: 0.05s;
}

a#btn_oldnavy:hover span:nth-child(3) {
    animation-delay: 0.1s;
}

a#btn_oldnavy:hover span:nth-child(4) {
    animation-delay: 0.15s;
}

a#btn_oldnavy:hover span:nth-child(5) {
    animation-delay: 0.2s;
}

a#btn_oldnavy:hover span:nth-child(6) {
    animation-delay: 0.25s;
}

a#btn_oldnavy:hover span:nth-child(7) {
    animation-delay: 0.3s;
}

a#btn_oldnavy:hover span:nth-child(8) {
    animation-delay: 0.35s;
}

@keyframes wave {
    0% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-10px);
    }

    50% {
        transform: translateY(5px);
    }

    75% {
        transform: translateY(-3px);
    }

    100% {
        transform: translateY(0);
    }
}

/* samsung button */
a#btn_samsung {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 100px;
    border-radius: 999px;
    background-color: #0033a0;
    color: #ffffff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 2px;
    text-decoration: none;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}


a#btn_samsung::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(115deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left 0.8s ease;
}

a#btn_samsung:hover::after {
    animation: samsung_shimmer 1.4s forwards;
}

@keyframes samsung_shimmer {
    0% {
        left: -80%;
    }

    100% {
        left: 130%;
    }
}

a#btn_tesla {
  display: block;
  width: 200px;
  height: 120px;
  margin: 80px auto;
  background: #e82127;
  -webkit-mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
          mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 1s ease;
}

a#btn_tesla::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
          mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
  transform: translateZ(20px);
}

a#btn_tesla::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
          mask: url('resources/Tesla_Motors.svg.png') center/contain no-repeat;
  transform: translateZ(-20px);
}

a#btn_tesla:hover {
  transform: rotateY(360deg);
}

a#btn_ibm {
  position: relative;
  display: inline-block;
  width: 180px;
  height: 100px;
  background-color: #fff;
  margin: 80px auto;
  transition: transform 0.4s ease;
}

a#btn_ibm .base {
  position: absolute;
  inset: 0;
  background: url("resources/IBM_logo.svg.png") center/contain no-repeat;
  opacity: 1;
  transition: opacity 0.25s ease;
}

a#btn_ibm .stripe {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #1466c3;
  transform: scaleX(0.001);
  transform-origin: left;
  opacity: 0;
  -webkit-mask: url("resources/IBM_logo.svg.png") center/contain no-repeat;
          mask: url("resources/IBM_logo.svg.png") center/contain no-repeat;
}

a#btn_ibm .s1 { clip-path: inset(0%    0 87.5% 0);  animation-delay: 0s; }
a#btn_ibm .s2 { clip-path: inset(12.5% 0 75%   0);  animation-delay: 0.08s; }
a#btn_ibm .s3 { clip-path: inset(25%   0 62.5% 0);  animation-delay: 0.16s; }
a#btn_ibm .s4 { clip-path: inset(37.5% 0 50%   0);  animation-delay: 0.24s; }
a#btn_ibm .s5 { clip-path: inset(50%   0 37.5% 0);  animation-delay: 0.32s; }
a#btn_ibm .s6 { clip-path: inset(62.5% 0 25%   0);  animation-delay: 0.40s; }
a#btn_ibm .s7 { clip-path: inset(75%   0 12.5% 0);  animation-delay: 0.48s; }
a#btn_ibm .s8 { clip-path: inset(87.5% 0 0%    0);  animation-delay: 0.56s; }

@keyframes stripeFill {
  0%   { transform: scaleX(0.001); opacity: 1; }
  100% { transform: scaleX(1);     opacity: 1; }
}

a#btn_ibm:hover .base {
  opacity: 0;
}

a#btn_ibm:hover .stripe {
  animation: stripeFill 0.5s cubic-bezier(0.25, 0.8, 0.4, 1) forwards;
}

a#btn_ibm:not(:hover) .base {
  opacity: 1;
}

/* lyft button */
a#btn_lyft {
  display: block;
  width: 120px;
  height: 160px;
  margin: 50px auto;
  background: url("resources/Lyft_logo.svg") center/contain no-repeat;
  transform-origin: center;
  perspective: 600px;
}

@keyframes pop-word {
  0% {
    transform: rotateX(0);
    opacity: 1;
  }
  50% {
    transform: rotateX(90deg);
    opacity: 0;
  }
  100% {
    transform: rotateX(0);
    opacity: 1;
  }
}
a#btn_lyft:hover {
  animation: pop-word 0.6s forwards;
}
