* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --color-text: #C3E5FD;
  --color-bg: #1A8CDD;
  --color-bg-accent: #8DCCF9;
  --size: clamp(5rem, 9rem + 30vmin, 20rem);
  --gap: calc(40px / 14);
  --duration: 60s;
  --scroll-start: 0;
  --scroll-end: calc(-100% - 30px);
}

html{
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background-attachment: fixed;
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

/* Animation Effects */
.float {
  animation: float 3s ease-in-out infinite;
}

.float-right {
  animation: float-right 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-30px);
  }
}

@keyframes float-right {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-30px) translateX(20px);
  }
}

/* Smooth Text Effects */
.decrypting-text {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Menu Icon Smooth Transition */
#menu-icon {
  transition: all 0.3s ease-in-out;
  display: inline-block;
}

/* Animation only on toggle */
#menu-icon.icon-animate {
  animation: iconRotate 0.3s ease-in-out;
}

@keyframes iconRotate {
  0% {
    opacity: 0.5;
    transform: rotate(-90deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Mobile Menu Animation */
#mobile-menu {
  transition: all 0.3s ease-in-out;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#mobile-menu:not(.hidden) {
  animation: slideInDown 0.3s ease-in-out forwards;
  pointer-events: auto;
}

#mobile-menu.menu-close {
  animation: slideOutUp 0.3s ease-in-out forwards;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Land in */

.landIn {
  display: flex;
  flex-wrap: wrap;
  line-height: 1.8;
  white-space: pre;

  span {
    animation: landIn 0.8s ease-out both;
  }
}

@keyframes landIn {
  from {
    opacity: 0;
    transform: translateY(-20%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* image change transition */
#sp-image {
  transition: opacity 0.3s ease-in-out;
}

#sp-image.fade-out {
  opacity: 0;
}

#sp-image.fade-in {
  opacity: 1;
}

/* Marquee */

.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--gap);
  mask-image: linear-gradient(
    var(--mask-direction, to right),
    hsl(0 0% 0% / 0),
    hsl(0 0% 0% / 1) 20%,
    hsl(0 0% 0% / 1) 80%,
    hsl(0 0% 0% / 0)
  );
}

.marquee__group {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: var(--gap);
  min-width: 100%;
  animation: scroll-x var(--duration) linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .marquee__group {
    animation-play-state: paused;
  }
}

.marquee--vertical {
  --mask-direction: to bottom;
}

.marquee--vertical,
.marquee--vertical .marquee__group {
  flex-direction: column;
}

.marquee--vertical .marquee__group {
  animation-name: scroll-y;
}

.marquee--reverse .marquee__group {
  animation-direction: reverse;
  animation-delay: -0.2s;
}

@keyframes scroll-x {
  from {
    transform: translateX(var(--scroll-start));
  }
  to {
    transform: translateX(var(--scroll-end));
  }
}

@keyframes scroll-y {
  from {
    transform: translateY(var(--scroll-start));
  }
  to {
    transform: translateY(var(--scroll-end));
  }
}

/* Element styles */
.marquee img {
  display: grid;
  place-items: center;
  width: var(--size);
  fill: var(--color-text);
  background: var(--color-bg-accent);
  aspect-ratio: 12/9;
  padding: calc(var(--size) / 10);
  border-radius: 0.5rem;
}

.marquee--vertical img {
  aspect-ratio: 1;
  width: calc(var(--size) / 1.5);
  padding: calc(var(--size) / 6);
}

/* Parent wrapper */
.wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin: auto;
  max-width: 100vw;
}

.wrapper--vertical {
  flex-direction: row;
  height: 100vh;
}

/* Toggle direction button */
.toggle {
  --size: 3rem;
  position: relative;
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: var(--size);
  height: var(--size);
  font: inherit;
  text-align: center;
  cursor: pointer;
  outline: none;
  border: none;
  border-radius: 50%;
  color: inherit;
  background-color: var(--color-bg-accent);
  z-index: 1;
}

.toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--color-text);
}

.toggle span {
  position: absolute;
  display: inline-block;
  top: 50%;
  left: calc(100% + 0.4em);
  width: fit-content;
  white-space: nowrap;
  transform: translateY(-50%);
  animation: fade 400ms 4s ease-out forwards;
  user-select: none;
}

.toggle img {
  --size: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  height: var(--size);
  fill: currentcolor;
  transform: translate(-50%, -50%);
  transition: transform 300ms cubic-bezier(0.25, 1, 0.5, 1);
}

.toggle--vertical img {
  transform: translate(-50%, -50%) rotate(-90deg);
}

@keyframes fade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
