@import url("https://fonts.cdnfonts.com/css/pp-neue-montreal");
@import url("https://fonts.cdnfonts.com/css/bai-jamjuree-2");

* {
  box-sizing: border-box;
  margin: 0;
}

[data-theme="dark"] {
  color-scheme: dark only;
}
[data-theme="light"],
html {
  color-scheme: light only;
}
@media (prefers-color-scheme: dark) {
    html {
      color-scheme: dark only;
    }
  }

[aria-pressed="true"] path:nth-of-type(1) {
  display: none;
}
[aria-pressed="false"] path:nth-of-type(2) {
  display: none;
}


body {
  display: flex;
  
  min-height: 100vh;
  background: canvas;
  color: canvasText;
  
}


:root {
  --green: rgb(42, 252, 152);
  --blue: rgb(41, 121, 255);
  --size: 45px;
  --line: color-mix(in lch, white, transparent 85%);
  background: linear-gradient(
        90deg,
        var(--line) 1px,
        transparent 1px var(--size)
      )
      50% 50% / var(--size) var(--size),
    linear-gradient(var(--line) 1px, transparent 1px var(--size)) 50% 50% /
      var(--size) var(--size),
    hsl(210 70% 34%);
}

::view-transition-new(body),
::view-transition-old(body) {
  animation: pan 1s ease-in-out;
  backface-visibility: hidden;
  box-shadow: 2.2px 61.3px 73.1px -2px hsl(0 0% 0% / 0.58);
}

::view-transition-new(body) {
  --sr: 180deg;
  background: canvas;
}

::view-transition-old(body) {
  --sr: 0deg;
  backface-visibility: hidden;
}

body {
  view-transition-name: body;
}


@keyframes pan {
  0% {
    transform: scale(1) rotateY(var(--sr));
  }
  25% {
    transform: scale(0.5) rotateY(var(--sr));
    box-shadow: 1.8px 50.7px 51.4px -3.2px hsl(0 0% 0% / 0.32);
  }
  75% {
    transform: scale(0.5) rotateY(calc(var(--sr) + 180deg));
    box-shadow: 1.8px 50.7px 51.4px -3.2px hsl(0 0% 0% / 0.32);
  }
  100% {
    transform: scale(1) rotateY(calc(var(--sr) + 180deg));
  }
}

:root {
  view-transition-name: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

[aria-pressed] {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 48px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  transition: background 0.2;
  cursor: pointer;
  background-color: color-mix(
    in lch,
    canvas,
    canvasText calc(var(--intent) * 15%)
  );
}

button svg {
  width: 50%;
}

button:is(:focus-visible, :hover) {
  --intent: 1;
}


/* begins*/


@keyframes float {
  from, to {
    transform: translateY(-0%);
  }
  
  50% {    
    transform: translateY(-3%);
  }
}

@keyframes background-pan {
  from {
    background-position: 1000% center;
  }
  
  to {
    background-position: 0% center;
  }
}

body {
  height: 100vh;
  
  margin: 0rem;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.line {
  display: flex;
  justify-content: space-between;
}

.word {
  
  font-size: clamp(2rem, 8vw, 10rem);
  font-family: "Rubik", sans-serif;
  margin: 0rem;
  text-transform: uppercase;
  transition: opacity 250ms ease;
}

a {
  text-decoration: none;
}

#text:has(.fancy:hover) .word:not(.fancy:hover) {
  opacity: 0.2;
}

.fancy span {
  display: inline-block;
}

.fancy > .outer {
  transition: transform 350ms ease;
}

.fancy:hover > .outer {
  transition-duration: 800ms;
}

.fancy:hover > .outer > .inner {
  animation: float 5s ease infinite;
}

.fancy:hover > .outer > .inner > .letter {
  background: linear-gradient(
    to right,
    var(--blue),
    var(--green),
    var(--blue)
  );
  background-size: 1000%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: background-pan 150s linear infinite;
}

.fancy:hover > .outer:nth-child(1) {
  transform: translate(-80%, 60%) rotate(8deg);
}

.fancy:hover > .outer:nth-child(2) {
  transform: translate(-40%, 20%) rotate(4deg);
}

.fancy:hover > .outer:nth-child(3) {
  transform: translate(-10%, 60%) rotate(-6deg);
}

.fancy:hover > .outer:nth-child(4) {
  transform: translate(0%, 8%) rotate(-8deg);
}

.fancy:hover > .outer:nth-child(5) {
  transform: translate(0%, -20%) rotate(5deg);
}

.fancy:hover > .outer:nth-child(6) {
  transform: translate(0%, 20%) rotate(-3deg);
}

.fancy:hover > .outer:nth-child(7) {
  transform: translate(0%, -40%) rotate(-5deg);
}

.fancy:hover > .outer:nth-child(8) {
  transform: translate(0%, 15%) rotate(10deg);
}

.fancy:hover > .outer:nth-child(9) {
  transform: translate(0%, -50%) rotate(8deg);
}

.fancy:hover > .outer:nth-child(10) {
  transform: translate(0%, 15%) rotate(-6deg);
}

.fancy:hover > .outer:nth-child(11) {
  transform: translate(50%, -10%) rotate(-3deg);
}

.fancy:hover > .outer:nth-child(12) {
  transform: translate(120%, -30%) rotate(-10deg);
}

