/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #ff6bcb;
  --primary-light: #ff9de6;
  --primary-dark: #e845a0;
  --pink: #ff4da6;
  --blue: #4dc9ff;
  --green: #4dff91;
  --yellow: #ffe44d;
  --orange: #ff8c4d;
  --red: #ff4d6a;
  --purple: #b84dff;
  --bg-dark: #1a0a2e;
  --bg-medium: #2d1b4e;
  --bg-light: #fff5f9;
  --text-main: #ffffff;
  --text-muted: #c9b8e8;
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 107, 203, 0.3);
  --glow: rgba(255, 107, 203, 0.5);
  --font-heading: 'Comfortaa', cursive;
  --font-body: 'Nunito', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.accent {
  background: linear-gradient(135deg, var(--yellow), var(--pink), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Confetti background ===== */
.paint-splashes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.splash {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  animation: floatSplash 15s ease-in-out infinite alternate;
}

.splash-1 { width: 450px; height: 450px; background: var(--pink); top: -150px; left: -100px; animation-delay: 0s; }
.splash-2 { width: 350px; height: 350px; background: var(--blue); top: 30%; right: -100px; animation-delay: -4s; }
.splash-3 { width: 400px; height: 400px; background: var(--yellow); bottom: 10%; left: 20%; animation-delay: -8s; }
.splash-4 { width: 280px; height: 280px; background: var(--green); top: 60%; left: -60px; animation-delay: -6s; }
.splash-5 { width: 250px; height: 250px; background: var(--purple); top: 10%; right: 30%; animation-delay: -2s; }

@keyframes floatSplash {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(50px, -40px) scale(1.15) rotate(10deg); }
  100% { transform: translate(-30px, 60px) scale(0.9) rotate(-5deg); }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem 6rem;
  z-index: 1;
}

.hero__avatar {
  position: relative;
  margin-bottom: 2.5rem;
}

.avatar-ring {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), var(--pink), var(--purple), var(--blue));
  padding: 6px;
  animation: rotateRing 4s linear infinite, bounce 2s ease-in-out infinite;
}

@keyframes rotateRing {
  to { filter: hue-rotate(360deg); }
}

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

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-medium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-inner svg {
  width: 100%;
  height: 100%;
}

.avatar-pencils {
  position: absolute;
  inset: -15px;
}

.pencil {
  position: absolute;
  font-size: 2rem;
  animation: bobPencil 2s ease-in-out infinite;
}

.pencil-1 { top: -20px; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.pencil-2 { top: 25%; right: -30px; animation-delay: 0.3s; }
.pencil-3 { bottom: -15px; left: 50%; transform: translateX(-50%); animation-delay: 0.6s; }
.pencil-4 { top: 25%; left: -30px; animation-delay: 0.9s; }

@keyframes bobPencil {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(15deg); }
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
  animation: popIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s both;
}

.hero__tagline {
  font-size: 1.3rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  animation: fadeUp 1s ease-out 0.6s both;
}

.avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 2rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}

.avatar-upload-btn:hover {
  background: rgba(255, 107, 203, 0.2);
  border-color: var(--pink);
  color: white;
  transform: scale(1.05);
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

.hero__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero__wave svg {
  width: 100%;
  height: auto;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

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

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 5rem 0;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  text-align: center;
  margin-bottom: 1rem;
}

.section__subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

/* ===== About ===== */
.about {
  background: linear-gradient(180deg, var(--bg-light), #ffe6f3);
  color: #2d1b4e;
}

.about .section__title {
  color: var(--bg-dark);
}

.about .accent {
  -webkit-text-fill-color: var(--primary-dark);
  background: none;
}

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

.about__card {
  background: white;
  border-radius: 1.5rem;
  padding: 2.2rem 1.5rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(255, 107, 203, 0.15);
  border: 3px solid transparent;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  opacity: 0;
  animation: fadeUp 0.6s ease-out forwards;
}

.about__card:nth-child(1) { animation-delay: 0.2s; }
.about__card:nth-child(2) { animation-delay: 0.4s; }
.about__card:nth-child(3) { animation-delay: 0.6s; }

.about__card:hover {
  transform: translateY(-10px) rotate(2deg);
  border-color: var(--pink);
  box-shadow: 0 12px 40px rgba(255, 107, 203, 0.3);
}

.about__icon {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  animation: wiggle 2s ease-in-out infinite;
}

.about__card:nth-child(2) .about__icon { animation-delay: 0.3s; }
.about__card:nth-child(3) .about__icon { animation-delay: 0.6s; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.about__card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 0.7rem;
}

.about__card p {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
}

/* ===== Gallery ===== */
.gallery {
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-medium));
}

.gallery__canvas {
  max-width: 700px;
  margin: 0 auto;
}

#artCanvas {
  width: 100%;
  height: 400px;
  border-radius: 1.2rem;
  border: 3px solid var(--pink);
  background: white;
  cursor: crosshair;
  display: block;
  touch-action: none;
  box-shadow: 0 0 30px rgba(255, 107, 203, 0.3);
}

.gallery__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--card-bg);
  border-radius: 1rem;
  border: 2px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.color-palette {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.25) rotate(10deg);
}

.color-btn.active {
  border-color: white;
  box-shadow: 0 0 12px var(--glow);
  transform: scale(1.2);
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brush-size-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.brush-size-label input[type="range"] {
  width: 90px;
  accent-color: var(--pink);
}

.tool-btn {
  background: rgba(255, 107, 203, 0.2);
  border: 2px solid var(--pink);
  border-radius: 0.7rem;
  padding: 0.5rem 0.8rem;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  color: white;
}

.tool-btn:hover {
  background: var(--pink);
  transform: scale(1.1);
}

.gallery__hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Upload section ===== */
.upload-section {
  text-align: center;
  margin: 2.5rem 0 1.5rem;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  border-radius: 2rem;
  color: white;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(255, 107, 203, 0.4);
}

.upload-btn:hover {
  transform: scale(1.07) translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 107, 203, 0.6);
}

.upload-btn:active {
  transform: scale(0.98);
}

/* ===== Artworks grid ===== */
.artworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.artwork-card {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeUp 0.5s ease-out forwards;
}

.artwork-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 107, 203, 0.3);
}

.artwork-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.artwork-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
}

.artwork-card:hover .artwork-delete {
  opacity: 1;
}

.artwork-delete:hover {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ===== Facts ===== */
.facts {
  background: linear-gradient(180deg, var(--bg-medium), var(--bg-dark));
}

.facts__list {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 650px;
  margin: 2rem auto 0;
}

.fact {
  display: flex;
  align-items: flex-start;
  gap: 1.4rem;
  padding: 1.4rem 1.8rem;
  background: var(--card-bg);
  border-radius: 1.2rem;
  border: 2px solid var(--card-border);
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  animation: fadeUp 0.5s ease-out forwards;
}

.fact:nth-child(1) { animation-delay: 0.15s; border-color: var(--pink); }
.fact:nth-child(2) { animation-delay: 0.3s; border-color: var(--blue); }
.fact:nth-child(3) { animation-delay: 0.45s; border-color: var(--purple); }
.fact:nth-child(4) { animation-delay: 0.6s; border-color: var(--green); }

.fact:hover {
  transform: translateX(12px) scale(1.02);
  box-shadow: 0 8px 30px var(--glow);
}

.fact__number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--yellow), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  line-height: 1.2;
}

.fact p {
  font-size: 1.08rem;
  line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3.5rem 1rem;
  border-top: 2px solid var(--card-border);
  background: linear-gradient(180deg, transparent, rgba(255, 107, 203, 0.1));
}

.footer__text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer__hearts {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 1.6rem;
  animation: bounce 1.5s ease-in-out infinite;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .avatar-ring {
    width: 130px;
    height: 130px;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  #artCanvas {
    height: 280px;
  }

  .gallery__tools {
    flex-direction: column;
    align-items: stretch;
  }

  .color-palette {
    justify-content: center;
  }

  .tool-actions {
    justify-content: center;
  }

  .artworks-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
