:root {
  --width-planet: 10vw;
  --width-sun: 15vw;

  --width-mercury: calc(var(--width-sun) * (5 / 34));
  --width-venus: calc(var(--width-sun) * (8 / 34));
  --width-earth: calc(var(--width-sun) * (8.5 / 34));
  --width-mars: calc(var(--width-sun) * (6 / 34));
  --width-jupiter: calc(var(--width-sun) * (20 / 34));
  --width-saturn: calc(var(--width-sun) * (19 / 34));
  --width-uranus: calc(var(--width-sun) * (12 / 34));
  --width-neptune: calc(var(--width-sun) * (12 / 34));
}

@keyframes line-right {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes text-show {
  from {
    opacity: 0;
    visibility: none;
    filter: blur(5px);
    scale: 1.2;
  }
  to {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    scale: 1;
  }
}

@keyframes planetsOnLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes show-content {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    backdrop-filter: blur(3px);
  }
}

@keyframes text-title {
  to {
    letter-spacing: 0;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-image: url("../img/f.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: black;
  overflow: hidden;
}

model-viewer {
  width: 100%;
  height: 50%;
}

.start {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.584);
  backdrop-filter: blur(2px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
}

.autor_logo {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: white;
  filter: brightness(70%);
  transition: filter 0.4s ease;
}

.autor_logo:hover {
  filter: brightness(100%);
}

.autor_logo > img {
  border-radius: 50%;
  height: 2.5rem;
}

.autor_logo::after {
  position: absolute;

  left: 3.5rem;
  content: "- kretuuuu";
  width: 0;
  display: block;
  overflow: hidden;
  transition: all 0.4s ease;
  text-wrap: nowrap;
}

.autor_logo:hover::after {
  width: 5rem;
}

.flags {
  width: 1rem;
}

.main {
  display: flex;
  width: max-content;
  min-width: 100%;
  overflow-x: auto;
}

.main.on-top {
  max-width: 100vw;
  animation: flash 0.8s 0.8s normal forwards;
}

.navbar {
  position: absolute;
  z-index: 999;
  width: 25%;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
}

.navbar.on-top {
  display: none;
}

.settings {
  overflow: hidden;
  display: flex;
  color: white;
  font-size: 1rem;
  width: 0;
  align-items: center;
  justify-content: space-around;
  border-bottom: 2px solid white;
  transition: all 0.5s linear;
}

.settings.on-top {
  overflow: visible;
  width: 100%;
}

.language {
  display: inline-block;
  text-wrap: nowrap;
}

.nav-button,
.lang {
  color: white;
  padding: 0.5rem;
  padding-top: 0.6rem;
  border: none;
  background: none;
  cursor: pointer;
}

.active {
  border-bottom: 0.1rem solid whitesmoke;
}

.container {
  width: max-content;
  column-gap: 5rem;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-around;
  transition: all 0.5s ease-out;
}

.container.on-top {
  padding-left: 4rem;
  padding-right: 4rem;
  column-gap: 0;
}

.content {
  overflow: hidden;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  text-wrap: nowrap;
  padding: 3rem;
  display: none;
  transition: display 0s ease-out 1.5s;
  opacity: 0;
}

.content.on-top {
  display: flex;
  animation: show-content 0.8s 0.8s normal forwards;
}

.icon {
  margin: 1.5rem;
  cursor: pointer;
  filter: brightness(70%);
  transition: all 0.2s ease-in;
}

.close-icon {
  width: 2.5rem;
  position: absolute;
  left: 0;
  top: 0;
}

.icon:hover {
  filter: brightness(100%);
}

.content-title {
  letter-spacing: 8px;
  opacity: 1;
  color: white;
  text-transform: uppercase;
}

.content-title.on-top {
  animation: text-title 1s 1s alternate forwards;
}

.content-element {
  width: 50%;
  user-select: none;
  visibility: hidden;
  color: white;
  text-wrap: wrap;
  text-align: center;
  filter: brightness(60%);
  transition: all 0.3s ease;
}

.content-element:hover {
  filter: brightness(100%);
}

.content-element.on-top {
  animation-name: text-show;
  animation-duration: 1s;
  animation-direction: alternate;
  animation-fill-mode: forwards;
}

.content-details {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 1.5rem;
}

.info-line {
  height: 1px;
  background-image: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.986),
    rgba(253, 253, 253, 0.535),
    rgba(0, 0, 0, 0)
  );
  border: 0;
}

.info-line.on-top {
  animation: line-right 0.8s 1.2s normal forwards;
}

/* DELAY ANIMACJI NAPISOW */

.position,
.diameter {
  animation-delay: 1.3s;
}

.mass,
.dist-sun {
  animation-delay: 1.6s;
}

.period,
.day-len {
  animation-delay: 1.9s;
}

.atmosphere,
.temperature {
  animation-delay: 2.2s;
}

.moons,
.fun-facts {
  animation-delay: 2.5s;
}

/* PLANETY KLASY */

.planets {
  border-radius: 50%;
  opacity: 0;
  width: var(--width-planet);
  transition: all 0.5s ease;
  animation: planetsOnLoad 0.5s 0.2s alternate forwards;
}

.planets.on-top {
  width: calc(var(--width-planet) * 3);
}

.planets.hidden {
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.planets.display-none {
  display: none;
}

/* SZEROKOSCI PLANET */

.mercury {
  width: var(--width-mercury);
}

.venus {
  width: var(--width-venus);
}

.earth {
  width: var(--width-earth);
}

.mars {
  width: var(--width-mars);
}

.jupiter {
  width: var(--width-jupiter);
}

.saturn {
  width: var(--width-saturn);
}

.uranus {
  width: var(--width-uranus);
}

.neptune {
  width: var(--width-neptune);
}

.sun {
  width: var(--width-sun);
}

.sun.on-top {
  width: calc(var(--width-sun) * 2);
}

@media screen and (max-width: 992px) {
  body {
    background: black;
    height: 100vh;
  }
  .main {
    height: 100%;
    flex-direction: column;
    align-items: center;
  }
  .container {
    margin: 5rem 0 5rem 0;
    width: calc(var(--width-sun) * 3);
    display: block;
    height: calc(var(--width-sun) * 3);

    column-gap: 0;
  }
  .planets,
  .sun,
  .planets.on-top,
  .sun.on-top {
    width: calc(var(--width-sun) * 3);
    height: calc(var(--width-sun) * 3);
  }

  .container.on-top {
    margin: 0;
    padding-left: 0rem;
    padding-right: 0rem;
    column-gap: 0;
  }
  .content {
    width: 100%;
    height: auto;
  }
  .content.on-top {
    padding: 1rem;
  }

  .main.on-top {
    height: max-content;
  }

  .content-element {
    width: 100%;
    font-size: 1rem;
    text-align: left;
  }

  .navbar {
    width: 90%;
    padding: 0;
  }

  .settings {
    background-color: black;
  }

  .autor_logo {
    filter: brightness(100%);
  }
}
