@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Epunda+Sans:wght@400;500;700&display=swap");

/* Color palette and fonts */
:root {
  --font-body: "Epunda Sans", sans-serif;
  --font-heading: "Cinzel", serif;

  --grey-100: oklch(97% 0 0);
  --grey-200: oklch(90% 0 0);
  --grey-300: oklch(80% 0 0);
  --grey-900: oklch(20% 0 0);

  --blue-100: oklch(65% 0.22 260); /* #0466C8 */
  --blue-200: oklch(60% 0.22 260); /* #0353A4 */
  --blue-300: oklch(55% 0.22 260); /* #023E7D */
  --blue-400: oklch(45% 0.22 260); /* #002855 */
}

/* ==================================== */
/* 🌟 LOGOTYPE FLIP + PULSE + FLASH 🌟 */
/* ==================================== */

/* Flip then Flash then Land */
@keyframes logoFlipRoll {
  0% {
    transform: rotateX(0deg) scale(1);
    opacity: 0;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px,
      rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px,
      rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
  }

  30% {
    opacity: 1;
  }

  90% {
    transform: rotateX(720deg) scale(1.2);
  }

  95% {
    transform: rotateX(720deg) scale(1.1);
    box-shadow: 0 0 25px 10px oklch(65% 0.22 260 / 0.8),
      0 0 80px 40px oklch(65% 0.22 260 / 0.4),
      0 0 200px 80px oklch(97% 0 0 / 0.6);
    filter: brightness(1.6);
  }
  99.99% {
    transform: scale(1.3);
    box-shadow: 0 0 70px 35px oklch(75% 0.22 40 / 0.9),
      0 0 150px 75px oklch(70% 0.25 50 / 0.7),
      0 0 300px 150px oklch(97% 0.05 70 / 0.5);
    filter: brightness(2.6);

    font-weight: 800;
  }
  100% {
    transform: rotateX(720deg) scale(1);
    opacity: 1;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 10px 25px,
      rgba(0, 0, 0, 0.12) 0px -6px 12px;
    filter: brightness(3);
  }
}

.navWrap {
  perspective: 2000px;
}

.navWrap a.logo {
  font-family: var(--font-heading);
  color: var(--grey-100);
  display: inline-block;
  transform-style: preserve-3d;
  transform-origin: center;
  backface-visibility: visible;
  animation: logoFlipRoll 0.8s ease-in-out both;
  will-change: transform, box-shadow, filter;
}

/* ============================ */
/* 🌟 ANIMATIONS PAGE GRID 🌟  */
/* ============================ */

.animation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}
.animation-cell {
  background: var(--grey-300);
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px oklch(20% 0 0 / 0.25);
}

.animation-box {
  inline-size: 100%;
  block-size: 10rem;
  background: var(--grey-100);
  border-radius: 0.5rem;
}

@media (min-width: 860px) {
  .animation-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===================================== */
/* 🌟 ANIMATION 1 — CLIP-PATH SHAPE 🌟  */
/* ===================================== */

.animation-box {
  inline-size: 100%;
  block-size: 18rem;
  background: black;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* This wrapper gets the glow instead of the spinning element */
.coin-wrapper {
  filter: drop-shadow(0 0 10px var(--blue-200))
    drop-shadow(0 0 20px var(--blue-300));
  display: flex;
  justify-content: center;
  align-items: center;
  inline-size: 8rem;
  block-size: 8rem;
}

/* The static coin container */
.coin {
  inline-size: 100%;
  block-size: 100%;
  position: relative;
  perspective: 1200px;
}

/* The rotating inner coin */
.coin-inner {
  inline-size: 100%;
  block-size: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: coinFlip 5s linear infinite;
}

/* Coin faces */
.side {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  clip-path: circle(50% at 50% 50%);
  backface-visibility: hidden;
}

/* FRONT */
.front {
  background-image: url("../images/boss-coin.png");
  transform: rotateY(0deg);
}

/* BACK */
.back {
  background-image: url("../images/cougar-coin.png");
  transform: rotateY(180deg);
}

/* Rotation + shrink */
@keyframes coinFlip {
  0% {
    transform: rotateY(0deg) scale(1.5);
  }
  25% {
    transform: rotateY(90deg) scale(0.6);
  }
  50% {
    transform: rotateY(180deg) scale(1.5);
  }
  75% {
    transform: rotateY(270deg) scale(0.6);
  }
  100% {
    transform: rotateY(360deg) scale(1.5);
  }
}

/* ===================================== */
/* 🌟 ANIMATION 2, Blend Mode Text   🌟 */
/* ===================================== */

.blend-box {
  position: relative;
  inline-size: 100%;
  block-size: 18rem;
  overflow: hidden;
  background: black;
  border-radius: 0.5rem;
}

/* Moving gradient background */
.blend-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    var(--grey-900),
    var(--blue-300),
    var(--blue-200),
    var(--blue-400)
  );
  background-size: 300% 100%;
  animation: slideGradient 10s ease-in-out infinite;
}

@keyframes slideGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Text using blend mode */

.blend-text {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: white;
  letter-spacing: 0.12rem;
  mix-blend-mode: normal;
  mix-blend-mode: screen;
  white-space: nowrap;

  /* Centering inside the animation cell */
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
}

.blend-text span {
  display: inline-block;
  animation: bounceWave 1.2s ease-in-out infinite;
}

/* WAVE LETTERS */
.blend-text span:nth-child(1) {
  animation-delay: 0s;
}
.blend-text span:nth-child(2) {
  animation-delay: 0.1s;
}
.blend-text span:nth-child(3) {
  animation-delay: 0.2s;
}
.blend-text span:nth-child(4) {
  animation-delay: 0.3s;
}
.blend-text span:nth-child(5) {
  animation-delay: 0.4s;
}
.blend-text span:nth-child(6) {
  animation-delay: 0.5s;
}
.blend-text span:nth-child(7) {
  animation-delay: 0.6s;
}
.blend-text span:nth-child(8) {
  animation-delay: 0.7s;
}
.blend-text span:nth-child(9) {
  animation-delay: 0.8s;
}
.blend-text span:nth-child(10) {
  animation-delay: 0.9s;
}

.blend-text span:nth-child(11) {
  animation-delay: 1s;
}
.blend-text span:nth-child(12) {
  animation-delay: 1.1s;
}
.blend-text span:nth-child(13) {
  animation-delay: 1.2s;
}
.blend-text span:nth-child(14) {
  animation-delay: 1.3s;
}
.blend-text span:nth-child(15) {
  animation-delay: 1.4s;
}
.blend-text span:nth-child(16) {
  animation-delay: 1.5s;
}
.blend-text span:nth-child(17) {
  animation-delay: 1.6s;
}
.blend-text span:nth-child(18) {
  animation-delay: 1.7s;
}
.blend-text span:nth-child(19) {
  animation-delay: 1.8s;
}
.blend-text span:nth-child(20) {
  animation-delay: 1.9s;
}
.blend-text span:nth-child(21) {
  animation-delay: 2s;
}

/*bounce up then down and grow then shrink*/
@keyframes bounceWave {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.12);
  }
}

/* ======================================= */
/* 🌟 ANIMATION 3, Filter, Lava Lamp   🌟 */
/* ========================================*/

.lava-box {
  position: relative;
  inline-size: 100%;
  block-size: 18rem;
  overflow: hidden;
  background: linear-gradient(180deg, oklch(20% 0 0), oklch(30% 0.1 250));
  border-radius: 0.5rem;
}

/* Shared blob styling */
.lava-blob {
  position: absolute;
  inline-size: 5rem;
  block-size: 5rem;
  background: linear-gradient(145deg, var(--blue-300), var(--blue-200));
  border-radius: 50%;
  filter: blur(3px) brightness(1.3);
  opacity: 0.85;
  animation: floatBlob 12s ease-in-out infinite;
}

/* control each small blob */
.blob1 {
  inset-block-start: 12%;
  inset-inline-start: 18%;
  animation-delay: 0s;
}

.blob2 {
  inset-block-start: 45%;
  inset-inline-start: 35%;
  animation-delay: 2.5s;
  inline-size: 6rem;
  block-size: 6rem;
}

.blob3 {
  inset-block-start: 70%;
  inset-inline-start: 30%;
  animation-delay: 5s;
  inline-size: 4.5rem;
  block-size: 4.5rem;
}

/* making the lava blobs float */
@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(0.85);
    filter: blur(3px) brightness(1.3);
  }
  16% {
    transform: translate(12px, -18px) scale(0.95);
    filter: blur(3px) brightness(1.3);
  }
  33% {
    transform: translate(22px, -35px) scale(1.05);
    filter: blur(4px) brightness(1.45);
  }
  50% {
    transform: translate(5px, -10px) scale(1.1);
    filter: blur(5px) brightness(1.25);
  }
  66% {
    transform: translate(-18px, 18px) scale(1.1);
    filter: blur(4px) brightness(1.3);
  }
  83% {
    transform: translate(30px, -5px) scale(0.95);
    filter: blur(3px) brightness(1.35);
  }
  100% {
    transform: translate(0, 0) scale(0.85);
    filter: blur(3px) brightness(1.3);
  }
}
/* ======================================= */
/* 🌟 SVG PROJECT BASE STYLES          🌟 */
/* ========================================*/

.svg-project {
  perspective: 1200px;
}

.svg-project svg * {
  transform-box: fill-box;
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* ======================================= */
/* 🌟 DRAGON vs KNIGHT ANIMATION       🌟 */
/* ========================================*/

/* Delay for page load */
#KNIGHT_FRONT_LEG,
#KNIGHT_BACK_LEG,
#KNIGHT_ARM,
#KNIGHT_HEAD,
#LARGE_FLAME,
#SMALL_FLAME_1 {
  animation-delay: 0.5s;
}

/* Knight walking */
#KNIGHT_FRONT_LEG {
  animation: legFront 2s ease-in-out infinite;
}

#KNIGHT_BACK_LEG {
  animation: legBack 2s ease-in-out infinite;
}

#KNIGHT_ARM {
  animation: armSwing 2s ease-in-out infinite;
}

#KNIGHT_HEAD {
  animation: headBob 2s ease-in-out infinite;
}

/* Flame breathing */
#LARGE_FLAME {
  animation: flamePulse 1s ease-in-out infinite;
}

#SMALL_FLAME_1 {
  animation: flameFlicker 0.3s ease-in-out infinite;
}

/* KNIGHT AND FIRE KEYFRAMES */
@keyframes legFront {
  0%,
  100% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(-10deg);
  }
}

@keyframes legBack {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes armSwing {
  0%,
  100% {
    transform: rotate(8deg);
  }
  50% {
    transform: rotate(-8deg);
  }
}

@keyframes headBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

@keyframes flamePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes flameFlicker {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

/* ===================================== */
/* 🌟 KNIGHT SLOWLY FORWARD MOVE     🌟 */
/* ===================================== */
@keyframes knightAdvance {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(60px);
  }
}
@keyframes shieldGuard {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(18px);
  }
}

.svg-project #KNIGHT_SHIELD {
  animation: shieldGuard 10s ease-in-out infinite alternate;
  will-change: transform;
}

/* Move the whole knight group */
.svg-project #_80_KNIGHT {
  animation: knightAdvance 10s ease-in-out infinite alternate;
  will-change: transform;
}

/* ===================================== */
/* 🌟 SMALL FLAME SPIN              🌟  */
/* ===================================== */

@keyframes flameFlip3D {
  0% {
    transform: rotateX(0deg) scale(1);
  }
  40% {
    transform: rotateX(180deg) scale(1.06);
  }
  60% {
    transform: rotateX(220deg) scale(1.03);
  }
  100% {
    transform: rotateX(360deg) scale(1);
  }
}

#SMALL_FLAME_1,
#SMALL_FLAME_2,
#SMALL_FLAME_3 {
  animation: flameFlip3D 1.1s ease-in-out 0.4s infinite;
}

#SMALL_FLAME_1 {
  animation-delay: 0.4s;
}
#SMALL_FLAME_2 {
  animation-delay: 0.55s;
}
#SMALL_FLAME_3 {
  animation-delay: 0.7s;
}
/* ======================== */
/* 🌟 DRAGON FLOATING   🌟 */
/* ======================== */

@keyframes dragonFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0);
  }
}
#_60_DRAGON {
  animation: dragonFloat 3.5s ease-in-out infinite;
}

/* ===================================== */
/* 🌟 SUN BEAMS GROW AND SHRINK      🌟 */
/* ===================================== */

@keyframes sunBeamPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}
#BEAM_1,
#BEAM_2,
#BEAM_3,
#BEAM_4,
#BEAM_5,
#BEAM_6 {
  animation: sunBeamPulse 4.5s ease-in-out infinite;
}
#BEAM_1 {
  animation-delay: 0s;
}
#BEAM_2 {
  animation-delay: 0.4s;
}
#BEAM_3 {
  animation-delay: 0.8s;
}
#BEAM_4 {
  animation-delay: 1.2s;
}
#BEAM_5 {
  animation-delay: 1.6s;
}
#BEAM_6 {
  animation-delay: 2s;
}

/* ===================================== */
/* 🌟 CLOUD DRIFT                     🌟*/
/* ===================================== */

@keyframes cloudDrift {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(200px);
  }
  100% {
    transform: translateX(0);
  }
}
#CLOUD_01,
#CLOUD_02,
#CLOUD_03 {
  animation-name: cloudDrift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
#CLOUD_01 {
  animation-duration: 12s;
}

#CLOUD_02 {
  animation-duration: 15s;
  animation-direction: alternate-reverse;
}

#CLOUD_03 {
  animation-duration: 17s;
}
/* ========================================== */
/* 🌟 FRONT HILL BACK AND FORTH MOVEMENT  🌟 */
/* ========================================== */
@keyframes knightAdvance-hill {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-60px);
  }
}

#HILL_FRONT {
  animation: knightAdvance-hill 10s ease-in-out infinite alternate;
  will-change: transform;
}
