@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap");

:root {
  --ghibli-sky: #a5d9e5;
  --ghibli-cloud: #e8f4f8;
  --ghibli-grass: #93c572;
  --ghibli-accent: #e08d60;
  --ghibli-dark: #594a47;
  --ghibli-text: #3d2c29;
  --ghibli-frame: #ffebc8;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(
    to bottom,
    var(--ghibli-sky),
    var(--ghibli-cloud)
  );
  background-attachment: fixed;
  font-family: "Quicksand", sans-serif;
  color: var(--ghibli-text);
  text-align: center;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100vw;
}

/* Content container with frosted glass effect */
.content-container {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  margin: 2rem;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10; /* Higher than clouds */
  animation: appear 1s ease-out forwards;
}

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

h1 {
  font-size: 3.2rem;
  margin-top: 1rem;
  color: var(--ghibli-dark);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
  animation: float 6s ease-in-out infinite;
  position: relative;
}

h1::before,
h1::after {
  content: "✿";
  font-size: 1.8rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  color: var(--ghibli-accent);
}

h1::before {
  left: -2rem;
  animation: sway 5s ease-in-out infinite;
}

h1::after {
  right: -2rem;
  animation: sway 5s ease-in-out infinite reverse;
}

p {
  font-size: 1.3rem;
  margin: 1rem;
  color: var(--ghibli-dark);
  max-width: 600px;
  line-height: 1.6;
}

/* Cat image container for flip effect */
.cat-container {
  display: block;
  position: relative;
  margin: 2rem auto 0;
  perspective: 1000px;
  cursor: pointer;
  width: 240px;
  height: 240px;
}

.cat-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.cat-flip.flipped {
  transform: rotateY(180deg);
}

.cat-face {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 4px solid var(--ghibli-frame);
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(255, 255, 255, 0.5);
  transition: all 0.5s ease;
  object-fit: cover;
}

.cat-face.back {
  transform: rotateY(180deg);
}

.cat-container:hover .cat-face {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2),
    0 0 50px rgba(255, 255, 255, 0.7);
}

.cat-container:hover .cat-face.back {
  transform: rotateY(180deg) scale(1.08) rotate(-3deg);
}

/* Legacy support for existing img.cat selector */
img.cat {
  width: 240px;
  height: auto;
  margin: 2rem auto 0;
  display: block;
  border: 4px solid var(--ghibli-frame);
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(255, 255, 255, 0.5);
  transition: all 0.5s ease;
  position: relative;
  z-index: 1;
}

img.cat:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2),
    0 0 50px rgba(255, 255, 255, 0.7);
}

img.cat::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: -1;
}

footer {
  margin-top: 3rem;
  font-size: 1rem;
  color: var(--ghibli-dark);
  position: relative;
  padding: 1rem;
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes sway {
  0% {
    transform: translateY(-50%) rotate(-5deg);
  }
  50% {
    transform: translateY(-50%) rotate(5deg);
  }
  100% {
    transform: translateY(-50%) rotate(-5deg);
  }
}

/* Decorative elements */
/* Cloud styling with better visibility */
.cloud {
  position: fixed;
  background: white;
  border-radius: 100px;
  box-shadow: 0 0 40px 5px rgba(255, 255, 255, 0.6);
  z-index: 1; /* Higher than background, lower than content */
}

/* Create multi-layered clouds for better definition */
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: white;
  border-radius: 100px;
}

.cloud::before {
  width: 60%;
  height: 120%;
  top: -50%;
  left: 15%;
}

.cloud::after {
  width: 50%;
  height: 100%;
  top: -10%;
  right: 5%;
}

/* Parallax cloud layers */
.cloud1 {
  width: 180px;
  height: 60px;
  top: 20%;
  left: -200px;
  animation: moveRightFar 70s linear infinite;
  opacity: 0.9;
  transform: scale(0.85);
  z-index: 1;
}

.cloud2 {
  width: 260px;
  height: 80px;
  top: 40%;
  right: -240px;
  animation: moveLeftMid 55s linear infinite;
  opacity: 1;
  transform: scale(1.1);
  z-index: 2;
}

.cloud3 {
  width: 160px;
  height: 50px;
  top: 65%;
  left: -180px;
  animation: moveRightNear 45s linear infinite 5s;
  opacity: 1;
  transform: scale(1.2);
  z-index: 3;
}

.cloud4 {
  width: 220px;
  height: 70px;
  top: 10%;
  right: -220px;
  animation: moveLeftFar 65s linear infinite 8s;
  opacity: 0.85;
  transform: scale(0.9);
  z-index: 1;
}

.cloud5 {
  width: 200px;
  height: 60px;
  top: 80%;
  left: -200px;
  animation: moveRightMid 50s linear infinite 12s;
  opacity: 0.95;
  transform: scale(1);
  z-index: 2;
}

/* Different speeds for parallax effect */
@keyframes moveRightNear {
  0% {
    transform: translateX(0) scale(1.2);
  }
  100% {
    transform: translateX(calc(100vw + 400px)) scale(1.2);
  }
}

@keyframes moveRightMid {
  0% {
    transform: translateX(0) scale(1);
  }
  100% {
    transform: translateX(calc(100vw + 400px)) scale(1);
  }
}

@keyframes moveRightFar {
  0% {
    transform: translateX(0) scale(0.85);
  }
  100% {
    transform: translateX(calc(100vw + 400px)) scale(0.85);
  }
}

@keyframes moveLeftNear {
  0% {
    transform: translateX(0) scale(1.2);
  }
  100% {
    transform: translateX(calc(-100vw - 400px)) scale(1.2);
  }
}

@keyframes moveLeftMid {
  0% {
    transform: translateX(0) scale(1.1);
  }
  100% {
    transform: translateX(calc(-100vw - 400px)) scale(1.1);
  }
}

@keyframes moveLeftFar {
  0% {
    transform: translateX(0) scale(0.9);
  }
  100% {
    transform: translateX(calc(-100vw - 400px)) scale(0.9);
  }
}

/* ✨ Glitter sparkles ✨  */
.sparkle {
  --h: 50;
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: hsl(var(--h) 100% 85%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: glitter 1.2s ease-out forwards;
  opacity: 0.9;
  box-shadow: 0 0 5px hsl(var(--h) 100% 70%);
  z-index: 20; /* Higher than content container */
}

@keyframes glitter {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 0.8;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(0);
    opacity: 0;
  }
}

/* Links and list styles */
ul {
  list-style-type: none;
  padding: 0;
  margin: 2rem auto;
}

li {
  margin: 1rem 0;
  transition: transform 0.3s ease;
}

li:hover {
  transform: translateX(5px);
}

a {
  color: var(--ghibli-dark);
  text-decoration: none;
  font-weight: 600;
  background: var(--ghibli-frame);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  display: inline-block;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

a:hover {
  background: white;
  color: var(--ghibli-accent);
  border-color: var(--ghibli-accent);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

a:hover::before {
  left: 100%;
}
/* Project description under links */
.project-description {
  display: block;
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--ghibli-dark);
}

/* Accessibility: larger click targets on touch devices */
@media (hover: none) {
  a,
  button {
    padding: 0.6rem 1.5rem;
  }
}