:root {
  /* Custom Color Palette */
  --tropical-indigo: #8783d1ff;
  --rose-quartz: #aa9abaff;
  --rosy-brown: #bfa4a4ff;
  --tea-rose-red: #d1abadff;
  --tea-rose-red-2: #e3b9bcff;
  /* Main theme colors mapped for design */
  --primary: var(--tropical-indigo);
  --accent: var(--rose-quartz);
  --highlight: var(--rose-quartz);
  --bg: #f7f6fd;
  --white: #fff;
  --shadow: 0 4px 24px rgba(135, 131, 209, 0.08);
  --gradient-main: linear-gradient(120deg, var(--tropical-indigo) 0%, var(--rose-quartz) 60%, var(--white) 100%);
  --pink-accent: var(--tea-rose-red);
}

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

/* Prevent any element from causing horizontal overflow */
* {
  max-width: 100%;
}

/* Allow specific elements to exceed if needed */
.game-circle, .website-cat {
  max-width: none;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--bg);
  color: var(--primary);
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

nav {
  width: 100%;
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 3px solid var(--tropical-indigo);
  overflow-x: auto; /* Allow horizontal scrolling only on nav if needed */
  min-height: fit-content;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--tropical-indigo);
  letter-spacing: 2px;
  flex-shrink: 0; /* Prevent logo from shrinking */
  text-shadow: 1px 1px 0 var(--rose-quartz);
}

.nav-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  padding: 0.3rem 1rem;
  border-radius: 0.5rem;
}

.nav-links a:hover {
  color: var(--white);
  background: var(--tropical-indigo);
}

.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--tropical-indigo) 0%, var(--rose-quartz) 80%, var(--white) 100%);
  text-align: center;
  padding: 4rem 1rem 2rem 1rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  text-shadow: 1px 1px 8px var(--tropical-indigo), 0 2px 12px var(--rose-quartz);
}

.hero p {
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 2rem;
  text-shadow: 1px 1px 6px var(--tropical-indigo), 0 2px 8px var(--rose-quartz);
}

.hero .hero-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 4px solid var(--tropical-indigo);
  background: var(--white);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.hero-btn {
  padding: 0.7rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  min-width: 120px;
  white-space: nowrap;
}

.hero-btn.primary {
  background: var(--accent);
  color: var(--white);
}

.hero-btn.secondary {
  background: var(--tropical-indigo);
  color: var(--white);
}

.hero-btn.tertiary {
  background: var(--rose-quartz);
  color: var(--white);
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(135, 131, 209, 0.3);
}

.section {
  max-width: 1100px;
  margin: 3rem auto;
  background: var(--white);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  padding: 2.5rem 1.5rem;
  border-left: 8px solid var(--tropical-indigo);
  width: calc(100% - 2rem); /* Ensure sections don't exceed viewport width */
  box-sizing: border-box;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tropical-indigo);
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 1px;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.about-content img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--tropical-indigo);
}

.about-content p {
  font-size: 1.1rem;
  color: var(--primary);
  max-width: 600px;
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid var(--tropical-indigo);
}

.project-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 32px rgba(135,131,209,0.18);
  border-color: var(--rose-quartz);
}

.project-card img {
  width: 100%;
  max-width: 220px;
  border-radius: 0.7rem;
  margin-bottom: 1rem;
  object-fit: cover;
}

.project-card h3 {
  font-size: 1.2rem;
  color: var(--tropical-indigo);
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.project-card a {
  color: var(--rose-quartz);
  text-decoration: underline;
  font-size: 0.98rem;
}

.resume-section {
  text-align: center;
}

.resume-section a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--tropical-indigo);
  color: var(--white);
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(135,131,209,0.10);
}

.resume-section a:hover {
  background: var(--rose-quartz);
  color: var(--tropical-indigo);
}

footer {
  text-align: center;
  padding: 2rem 0 1rem 0;
  color: var(--tropical-indigo);
  font-size: 1rem;
  background: none;
}

/* Parallax/scroll effect for images */
.parallax {
  min-height: 300px;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 1.5rem;
  margin: 2rem auto;
  border: 3px solid var(--tropical-indigo);
  box-shadow: 0 2px 16px rgba(135,131,209,0.10);
  /* subtle pink overlay for accent */
  position: relative;
  width: calc(100% - 2rem);
  max-width: 1100px;
}

.parallax::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 70%, var(--tea-rose-red-2) 100%);
  opacity: 0.18;
  border-radius: 1.5rem;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 800px) {
  .section { 
    padding: 1.2rem 0.5rem; 
    margin: 2rem 1rem; /* Add side margins for mobile */
    width: calc(100% - 2rem);
  }
  .hero h1 { font-size: 2.1rem; }
  .hero {
    padding: 3rem 1rem 2rem 1rem;
  }
  .about-content { flex-direction: column; }
  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }
  
  /* Make hero buttons more mobile-friendly */
  .hero-buttons {
    gap: 0.8rem;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  
  .hero-btn {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 500px) {
  nav { 
    flex-direction: column; 
    gap: 0.7rem; 
    padding: 0.7rem 0.5rem;
    overflow-x: hidden; /* Prevent nav overflow on very small screens */
  }
  .nav-links { 
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .nav-links a {
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
  }
  .score-display {
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
  }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1.1rem; }
  .section-title { font-size: 1.4rem; }
  .section {
    margin: 1.5rem 0.5rem;
    padding: 1rem 0.7rem;
    width: calc(100% - 1rem);
  }
  
  /* Hero buttons for small screens */
  .hero-buttons {
    gap: 0.6rem;
    max-width: 250px;
  }
  
  .hero-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-width: 100px;
  }
  
  .parallax {
    margin: 1.5rem auto;
    min-height: 180px;
    width: calc(100% - 1rem);
    background-attachment: scroll;
  }
}

@media (max-width: 350px) {
  .nav-logo {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
  .section {
    margin: 1rem 0.25rem;
    padding: 0.8rem 0.5rem;
    width: calc(100% - 0.5rem);
  }
  
  .hero-buttons {
    max-width: 200px;
  }
  
  .hero-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: 80px;
  }
  
  .parallax {
    margin: 1rem auto;
    min-height: 200px;
    width: calc(100% - 1rem);
    background-attachment: scroll; /* Fixed attachment can cause issues on mobile */
  }
}

/* Game Elements */
.score-display {
  background: var(--tropical-indigo);
  color: var(--white);
  padding: 0.3rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.game-circle {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--tea-rose-red), var(--tropical-indigo));
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(135, 131, 209, 0.3);
  border: 3px solid var(--white);
  transition: transform 0.2s, opacity 0.3s;
  animation: pulse 2s infinite;
}

.game-circle:hover {
  transform: scale(1.1);
}

.game-circle.clicked {
  animation: pop 0.4s ease-out forwards;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.8; }
  100% { transform: scale(0); opacity: 0; }
}

/* Circle size based on screen size */
.circle-large { width: 80px; height: 80px; }
.circle-medium { width: 60px; height: 60px; }
.circle-small { width: 40px; height: 40px; }

/* Website Cat */
.website-cat {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 80px;
  height: 80px;
  z-index: 75;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.website-cat:hover {
  transform: scale(1.1);
}

.cat-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Cat base - always visible */
.cat-body {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 30px;
  background: var(--tropical-indigo);
  border-radius: 50% 50% 40% 40%;
  border: 2px solid var(--white);
}

.cat-head {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 30px;
  background: var(--tropical-indigo);
  border-radius: 50% 50% 40% 40%;
  border: 2px solid var(--white);
}

/* Cat features that appear with clicks */
.cat-ears {
  position: absolute;
  top: -8px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cat-ear-left, .cat-ear-right {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 12px solid var(--tropical-indigo);
}

.cat-ear-left { left: 2px; }
.cat-ear-right { right: 2px; }

.cat-eyes {
  position: absolute;
  top: 8px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cat-eye-left, .cat-eye-right {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--white);
  border-radius: 50%;
}

.cat-eye-left { left: 8px; }
.cat-eye-right { right: 8px; }

.cat-nose {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3px solid var(--tea-rose-red);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cat-whiskers {
  position: absolute;
  top: 12px;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.whisker {
  position: absolute;
  width: 12px;
  height: 1px;
  background: var(--white);
}

.whisker-left-1 { left: -5px; top: 5px; }
.whisker-left-2 { left: -5px; top: 8px; }
.whisker-right-1 { right: -5px; top: 5px; }
.whisker-right-2 { right: -5px; top: 8px; }

.cat-tail {
  position: absolute;
  bottom: 15px;
  right: -15px;
  width: 20px;
  height: 4px;
  background: var(--tropical-indigo);
  border-radius: 10px;
  transform-origin: left center;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: tail-wag 2s infinite;
}

@keyframes tail-wag {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

/* Cat evolution stages */
.cat-stage-1 .cat-ears { opacity: 1; }
.cat-stage-2 .cat-eyes { opacity: 1; }
.cat-stage-3 .cat-nose { opacity: 1; }
.cat-stage-4 .cat-whiskers { opacity: 1; }
.cat-stage-5 .cat-tail { opacity: 1; }

/* New evolution stages */
.cat-spots, .cat-crown, .cat-wings, .cat-sparkles, .cat-rainbow-aura {
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Stage 6: Spots */
.cat-spots {
  top: 8px;
  left: 12px;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.cat-spots::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 8px;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.cat-spots::after {
  content: '';
  position: absolute;
  top: 5px;
  left: -8px;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.cat-stage-6 .cat-spots { opacity: 1; }

/* Stage 7: Crown */
.cat-crown {
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid #ffd700;
}

.cat-crown::before {
  content: '';
  position: absolute;
  top: 8px;
  left: -3px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 4px solid #ffd700;
}

.cat-crown::after {
  content: '';
  position: absolute;
  top: 8px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 4px solid #ffd700;
}

.cat-stage-7 .cat-crown { opacity: 1; }

/* Stage 8: Wings */
.cat-wings {
  top: 12px;
  left: -12px;
  width: 8px;
  height: 12px;
  background: linear-gradient(45deg, #ff9ff3, #f368e0);
  border-radius: 50% 20% 50% 20%;
  transform: rotate(-20deg);
}

.cat-wings::after {
  content: '';
  position: absolute;
  top: 0;
  left: 35px;
  width: 8px;
  height: 12px;
  background: linear-gradient(45deg, #ff9ff3, #f368e0);
  border-radius: 20% 50% 20% 50%;
  transform: rotate(20deg);
}

.cat-stage-8 .cat-wings { 
  opacity: 1; 
  animation: wing-flap 2s infinite;
}

@keyframes wing-flap {
  0%, 100% { transform: rotate(-20deg) translateY(0px); }
  50% { transform: rotate(-25deg) translateY(-2px); }
}

/* Stage 9: Sparkles */
.cat-sparkles {
  top: -5px;
  left: -10px;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 
    15px 5px 0 #ffd700,
    25px -3px 0 #ff69b4,
    35px 8px 0 #00ffff,
    45px 2px 0 #ff1493;
}

.cat-stage-9 .cat-sparkles { 
  opacity: 1;
  animation: sparkle 3s infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.2) rotate(90deg); }
  50% { transform: scale(0.8) rotate(180deg); }
  75% { transform: scale(1.1) rotate(270deg); }
}

/* Stage 10: Rainbow Aura */
.cat-rainbow-aura {
  top: -8px;
  left: -8px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: conic-gradient(
    #ff0000, #ff8000, #ffff00, #80ff00, 
    #00ff00, #00ff80, #00ffff, #0080ff, 
    #0000ff, #8000ff, #ff00ff, #ff0080, #ff0000
  );
  filter: blur(1px);
}

.cat-stage-10 .cat-rainbow-aura { 
  opacity: 0.7;
  animation: rainbow-pulse 2s infinite;
}

@keyframes rainbow-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.1) rotate(180deg); opacity: 0.9; }
}

/* Mobile adjustments */
@media (max-width: 500px) {
  .website-cat {
    width: 60px;
    height: 60px;
    bottom: 15px;
    left: 15px;
  }
  
  .cat-body {
    width: 30px;
    height: 22px;
  }
  
  .cat-head {
    width: 26px;
    height: 22px;
    bottom: 25px;
  }
}