:root {
  --background-image-url: url("images/home/chat-bubble.png");
  --bg-size: 70px;
  --title-color: white;
  --inset-blur: 8px;
  --inset-blur-spread: 3px;
  --reg-blur: 10px;
  --reg-blur-spread: 4px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 12px;
  padding: 2px;
  background: rgb(255,255,255,0)
}

::-webkit-scrollbar-track {
  background: rgb(50,50,50);
  border-radius: 100vh;
}

::-webkit-scrollbar-thumb {
  background: rgb(150,150,150);
  border-radius: 100vh;
  border: 3.5px solid rgb(50,50,50);
}

html, body {
  font-family: "League Spartan", sans-serif;
}

html {
  width: 100%;
  min-height:100%;
}

body {
  /*background-image: var(--background-image-url), linear-gradient(to bottom, rgba(98, 0, 255, 0.8) 10%, rgba(98, 0, 255, 0.2) 100%);*/
  background-image: linear-gradient(to bottom, transparent 0%,  rgb(146, 141, 165) 20%, rgb(146, 141, 165) 80%, transparent 100%); 
  background-size: var(--bg-size);
  background-attachment: fixed;
  background-position: center;
  margin: 0;
  margin-bottom: 32px;
  background-color: rgb(117, 117, 117);
  transition: background-color 2s, background-size 0.5s;
  overflow-x: hidden;
  /*animation*/
  animation-name: body-fadein;
  animation-duration: 0.7s;
  min-width: 100%;
}

.title {
  /*background: linear-gradient(to bottom, var(--title-color) 5%, transparent 80%);*/
  color: rgb(220, 220, 220);
  padding: 32px 20px 32px 20px;
  -webkit-text-stroke: 0.1em black;
  cursor: default;
  text-align: center;
  margin: 0 auto;
  border-radius: 1vh 1vh 0 0;
  position: sticky;
}

.title h1 {
  font-size: 4em;
  margin: 0;
}

.title h2 {
  font-size: 32px;
  margin-top: 6.4px;
  margin-left: 6px;
}

body:has(.section:hover) {
  --bg-size: 80px;
}

body:has(.section.apple:hover) {
  background-color: rgb(0, 122, 255);
  --background-image-url: url("/images/home/apple-xxl.png");
}

body:has(.section.snapchat:hover) {
  background-color: rgb(247, 244, 0);
}

body:has(.section.attributions:hover) {
  background-color: rgb(50, 50,50);
  --background-image-url: url("/images/home/attribution.png");
}

.sections:last-child {
  margin-bottom: 32px;
}

.sections > h2, .coming-soon {
  color: white;
  margin-left: 32px;
  font-size: 32px;
}

.sections > h2 span {
  font-size: 27px;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.2s, scale 0.2s;
}

.sections:hover > h2 span {
  scale: 1.5;
  transform: rotateY(180deg);
  transition: transform 0.2s, scale 0.2s;
}

.sections {
  margin-left: -50px;
  /*animation*/
  animation-name: fade-from-left;
  animation-duration: 1s;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
}

.tutorial {
  cursor: pointer;
  font-family: 'League Spartan';
  font-size: 16px;
  background-color: transparent;
  color: rgb(0, 0, 219);
  border: 2px solid rgb(0, 0, 219);
  outline: none;
  transition: border 0.2s;
}

.tutorial:hover {
  border: 2px solid rgb(0, 113, 235);
  transition: border 0.2s;
}

.coming-soon, .tutorial {
  margin-left: -50px;
  /* animation */
  animation: text-fade-from-left;
  animation-duration: 1s;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
}

/* remove this when other section are added
.section {
  display: inline-block;
} 

@media screen and (max-width:950px){
 .section {
    display: block;
 }
} */

.section-elements {
  display: flex;
  gap: 16px;
  margin: -10px 22px;
  padding: 10px;
  overflow-x: auto;
}

.section-elements::-webkit-scrollbar {
  height: 0;
  transition: height 0.3s;
}

.section-elements:hover::-webkit-scrollbar {
  height: 12px;
  transition: height 0.3s;
}

.section-title {
  color: white;
  margin-left: 32px;
}

.section-element {
  background-color: rgb(200, 200, 200, 0.5);
  backdrop-filter: blur(25px);
  border: 2px solid white;
  border-radius: 8px;
  width: 260px;
  height: 260px;
  min-width: 260px;
  min-height:260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: box-shadow 0.2s, border 0.2s;
}

.apple .section-element:hover {
  box-shadow: 0 0 var(--reg-blur) var(--reg-blur-spread) rgb(0, 122, 255);
  border: 2px solid rgb(9, 159, 255);
  transition: box-shadow 0.2s, border 0.2s;
}

.snapchat .section-element:hover {
  box-shadow: 0 0 var(--reg-blur) var(--reg-blur-spread) rgb(247, 244, 0);
  border: 2px solid rgb(255, 252, 0);
  transition: box-shadow 0.2s, border 0.2s;
}

.attributions .section-element:hover {
  box-shadow: 0 0 var(--reg-blur) var(--reg-blur-spread) rgb(50, 50,50);
  border: 2px solid rgb(103, 103, 103);
  transition: box-shadow 0.2s, border 0.2s;
}

/*element img*/
.section-element img {
  width: 260px;
  height: 162.5px;
  transition: background-color 0.5s, scale 0.3s;
  object-fit: contain;
  overflow: hidden;
}

.section-element:hover img {
  background-color: rgba(210, 210, 210, 0.4);
  transition: background-color 0.5s, scale 0.3s;
  scale: 1.1;

}

/*element-info*/
.section-element .element-info {
  width: 240px;
  height: 97.5px;
  transition: background-color 0.5s;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 0 10px 0 10px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  z-index: 2;
}

.section-element:hover .element-info {
  background-color: rgb(240, 240, 240);
  transition: background-color 0.5s;
}

.element-info .element-title {
  font-weight: bold;
  font-size: 22px;
}

span.material-icons-outlined {
  font-size: 20px;
  vertical-align: -21%;
}

.element-info a, .tutorial {
  text-decoration: none;
  padding: 4px 8px;
  width: fit-content;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s, scale 0.2s;
}

.element-info a {
  color: rgb(0, 0, 255);
}

.element-info a:hover, .tutorial:hover {
  color: white;
  background-color: rgb(0, 113, 235);
  transition: background-color 0.2s, color 0.2s;
}

.element-info a:active, .tutorial:active {
  scale: 0.9;
  transition: scale 0.2s;
}

.element-info a:hover span.material-icon-outlined {
  margin-left: 15px;
  transition: margin-left 0.2s;
}

/*box shadow container*/
.box-shadow-container {
  width: 260px;
  height: 260px;
  z-index: 2;
  position: absolute;
  transition: box-shadow 0.2s;
  pointer-events: none;
}

.apple .section-element:hover .box-shadow-container {
  box-shadow: inset 0 0 var(--inset-blur) var(--inset-blur-spread) rgb(0, 122, 255);
  transition: box-shadow 0.2s;
}

.snapchat .section-element:hover .box-shadow-container {
  box-shadow: inset 0 0 var(--inset-blur) var(--inset-blur-spread) rgb(247, 244, 0);
  transition: box-shadow 0.2s;
}

.attributions .section-element:hover .box-shadow-container {
  box-shadow: inset 0 0 var(--inset-blur) var(--inset-blur-spread) rgb(50, 50,50);
  transition: box-shadow 0.2s;
}

/*tutorials*/
.background-cover {
  z-index: 998;
  width: 100%;
  height: 100%;
  display: none;
  position: fixed;
  top: 0;
  opacity: 0;
  transition-property: display opacity;
  transition-duration: 0.6s;
  transition-behavior: allow-discrete;
}

.tutorial-popup {
  background-color: white;
  pointer-events: all;
  width: max-content;
  max-width: 500px;
  position: fixed;
  left: 50%;
  right: 50%;
  top: 5%;
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 999;
  transition: height 0.5s;
}

.tutorial-popup[data-open="false"] {
  top: -100%;
  transition: top 0.6s;
}

.tutorial-popup[data-open="true"] {
  top: 5%;
  transition: top 0.6s;
}

body:has(.tutorial-popup[data-open="true"]) {
  pointer-events: none;
  overflow: hidden;
}

body:has(.tutorial-popup[data-open="true"]) .background-cover {
  display: block;
  background-color: rgba(128,128,128,0.8);
  backdrop-filter: blur(5px);
  opacity: 1;
  
  @starting-style {
    opacity: 0;
  }
}

.tutorial-popup .tutorial-title {
  text-align: center;
  font-size: 32px;
  font-weight: bold;
}

.tutorial-pages {
  width: 95%;
  border: 2px solid black;
  transition: height 0.2s;
  margin: 16px 0;
  border-radius: 8px;
}

.tutorial-pages::after {
  content: attr(data-current-page) "/" attr(data-max-page);
  position: fixed;
  left: 50%;
  right: 50%;
  transform: translateX(-50%);
  margin-top: 5px;
}

.tutorial-page {
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tutorial-page .tutorial-emph {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.tutorial-page .tutorial-text {
  font-size:18px;
  text-align: justify;
}

.tutorial-page img {
  max-width: 100%;
  width: 60%;
  margin: 12px 0;
}

.tutorial-page img.tutorial-large-img {
  max-width: 100%;
  width: unset;
}

.tutorial-buttons {
  display: flex;
  justify-content: space-between;
  width: 90%;
}

.tutorial-buttons button {
  outline: none;
  border: none;
  background-color: transparent;
  font-size: 16px;
  font-family: 'League Spartan';
  cursor: pointer;
  padding: 8px 8px;
  border-radius: 6px;
  transition: scale 0.2s;
}

.tutorial-buttons button:active {
  scale: 0.9;
  transition: scale 0.2s;
}

.tutorial-buttons [data-type="close"] {
  color: white;
  background-color: rgb(0, 113, 235);
}

.tutorial-buttons-right button{
  color: rgb(0, 0, 255);
}

.tutorial-buttons-right button:hover {
  text-decoration: underline;
}

.tutorial-buttons-right button[disabled] {
  color: rgb(120, 120, 255);
  cursor: not-allowed;
}

.tutorial-buttons-right button[disabled]:hover {
  text-decoration: none;
}

/*display scaling*/
@media screen and (max-width: 540px) {
  .tutorial-popup {
    max-width: 85%;
  }
}

/*ANIM KEYFRAMES*/
@keyframes body-fadein {
  0%{
    margin-top: 250px;
    opacity: 0;
  }
  75%{
    opacity: 1;
  }
  100% {
    margin-top: 0px;
  }
}

@keyframes fade-from-left {
  0% {
    margin-left: -50px;
  }
  100% {
    margin-left: 0;
  }
}

@keyframes text-fade-from-left {
  0% {
    margin-left: -50px;
  }
  100% {
    margin-left: 32px;
  }
}

@media(prefers-reduced-motion) {
  body, .sections, .coming-soon, .tutorial {
    animation-duration: 0s;
    animation-delay: 0s;
    transition: 0s
  }

  .section-element img, .section-element:hover img {
    transition: 0s;
  }

  .sections {
    margin-left: 0;
  }
}