:root {
  --c-bg: #fff7fb;
  --c-purple: #7c3aed;
  --c-pink: #ff5fa2;
  --c-blue: #2dd4ff;
  --c-yellow: #ffd166;
  --c-green: #34d399;
  --c-orange: #ff8c42;
  --c-text: #2b2348;
  --c-card: #ffffff;
  --shadow: 0 12px 30px rgba(124, 58, 237, 0.15);
  --radius: 22px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, .logo { font-family: 'Baloo 2', cursive, sans-serif; }

/* Animated background blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.45; animation: float 18s ease-in-out infinite; }
.blob-1 { width: 340px; height: 340px; background: var(--c-pink); top: -80px; left: -60px; }
.blob-2 { width: 300px; height: 300px; background: var(--c-blue); top: 30%; right: -80px; animation-delay: -4s; }
.blob-3 { width: 280px; height: 280px; background: var(--c-yellow); bottom: 5%; left: 10%; animation-delay: -8s; }
.blob-4 { width: 320px; height: 320px; background: var(--c-green); bottom: -100px; right: 20%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-30px, 25px) scale(0.95); }
}

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  transition: box-shadow .3s, padding .3s;
}
.navbar.scrolled { box-shadow: var(--shadow); padding: 8px 28px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--c-purple); text-decoration: none; }
.nav-links { list-style: none; display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none; color: var(--c-text); font-weight: 500;
  padding: 8px 14px; border-radius: 999px; transition: all .25s;
}
.nav-links a:hover { background: var(--c-purple); color: #fff; transform: translateY(-2px); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--c-purple); }

/* Hero */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 100px 20px 40px;
}
.avatar-wrap { position: relative; width: 170px; height: 170px; margin: 0 auto 24px; }
.avatar {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 6px solid #fff; box-shadow: var(--shadow); position: relative; z-index: 2;
  animation: bob 4s ease-in-out infinite;
}
.avatar-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(var(--c-pink), var(--c-blue), var(--c-yellow), var(--c-green), var(--c-pink));
  animation: spin 6s linear infinite; z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-title { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.15; }
.gradient-text {
  background: linear-gradient(90deg, var(--c-pink), var(--c-purple), var(--c-blue));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% auto; animation: shine 4s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero-roles { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  background: #fff; padding: 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 600; font-size: .95rem;
  transition: transform .25s;
}
.chip:hover { transform: translateY(-4px) rotate(-2deg); }
.hero-tagline { font-style: italic; font-size: 1.2rem; color: var(--c-purple); margin-bottom: 26px; }

.btn-primary {
  display: inline-block; background: linear-gradient(90deg, var(--c-pink), var(--c-purple));
  color: #fff; text-decoration: none; padding: 14px 32px; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem; border: none; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
}
.btn-primary:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 18px 40px rgba(255, 95, 162, .4); }

.scroll-hint { margin-top: 40px; font-size: 2rem; color: var(--c-purple); animation: bob 2s ease-in-out infinite; }

/* Sections */
.section { max-width: 1100px; margin: 0 auto; padding: 80px 24px; }
.section-title { text-align: center; font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 14px; color: var(--c-purple); }
.section-sub { text-align: center; margin-bottom: 36px; font-size: 1.1rem; }
.sub-title { text-align: center; margin: 50px 0 24px; font-size: 1.5rem; color: var(--c-pink); }

.card {
  background: var(--c-card); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .3s;
}
.card p { margin-bottom: 12px; }
.card:hover { transform: translateY(-6px); }

.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.stat-card { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 2.4rem; font-weight: 800; color: var(--c-pink); font-family: 'Baloo 2', sans-serif; }
.stat-label { font-size: .9rem; opacity: .8; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.skill-card {
  background: #fff; border-radius: var(--radius); padding: 28px 24px; text-align: center;
  box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; cursor: default;
}
.skill-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 20px 44px rgba(124,58,237,.25); }
.skill-icon { font-size: 3rem; margin-bottom: 12px; }
.skill-card h3, .music-card h3, .anime-card h3 { margin-bottom: 10px; color: var(--c-purple); }

/* Bars */
.bars { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.bar-item span { font-weight: 600; }
.bar { background: #efe6ff; border-radius: 999px; height: 16px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-pink), var(--c-blue)); transition: width 1.4s ease; }
.bar.animate i { width: var(--w); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.gallery-item { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; background:#fff; }
.gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .5s; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item figcaption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
  background: linear-gradient(transparent, rgba(124,58,237,.85)); color: #fff; font-weight: 600;
  transform: translateY(100%); transition: transform .35s;
}
.gallery-item:hover figcaption { transform: translateY(0); }

/* Music */
.music-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.music-card { text-align: center; }
.equalizer { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 70px; margin-top: 36px; }
.equalizer span { width: 10px; background: linear-gradient(var(--c-pink), var(--c-purple)); border-radius: 6px; animation: eq 1s ease-in-out infinite; }
.equalizer span:nth-child(2){animation-delay:.2s} .equalizer span:nth-child(3){animation-delay:.4s}
.equalizer span:nth-child(4){animation-delay:.1s} .equalizer span:nth-child(5){animation-delay:.5s}
.equalizer span:nth-child(6){animation-delay:.3s} .equalizer span:nth-child(7){animation-delay:.15s}
.equalizer span:nth-child(8){animation-delay:.45s}
@keyframes eq { 0%,100% { height: 14px; } 50% { height: 64px; } }

/* Anime */
.anime-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.anime-card {
  background: linear-gradient(135deg, #1e1b4b, #4c1d95); color: #fff;
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
  transition: transform .3s; position: relative; overflow: hidden;
}
.anime-card h3 { color: var(--c-yellow); }
.anime-card:hover { transform: translateY(-8px) rotate(-1deg); }

/* Family */
.family-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.family-card { background: #fff; border-radius: var(--radius); padding: 26px; text-align: center; box-shadow: var(--shadow); transition: transform .3s; }
.family-card:hover { transform: translateY(-8px); }
.fam-emoji { font-size: 3rem; }
.fam-name { font-weight: 700; color: var(--c-pink); margin-bottom: 6px; }

/* Fun facts */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.fact { background: #fff; border-radius: 16px; padding: 18px 20px; font-weight: 600; box-shadow: var(--shadow); transition: transform .25s; }
.fact:hover { transform: scale(1.05); background: var(--c-yellow); }

/* Contact */
.contact-form { max-width: 540px; margin: 0 auto; display: grid; gap: 14px; }
.contact-form input, .contact-form textarea {
  padding: 14px 18px; border-radius: 14px; border: 2px solid #efe6ff;
  font-family: inherit; font-size: 1rem; outline: none; transition: border .25s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--c-purple); }
.form-note { text-align: center; color: var(--c-green); font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  background: #fff; border: none; width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow);
  margin-left: 10px; transition: transform .25s; line-height: 1;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.1); }

/* Best Friends */
.friends-intro { max-width: 820px; margin: 0 auto 36px; }
.friends-intro p { margin-bottom: 12px; }
.friends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.friend-card {
  background: #fff; border-radius: var(--radius); padding: 28px 22px; text-align: center;
  box-shadow: var(--shadow); transition: transform .3s;
}
.friend-card:hover { transform: translateY(-8px) scale(1.03); }
.friend-card h3 { color: var(--c-purple); margin-bottom: 6px; }
.friend-avatar {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2rem; color: #fff;
  background: linear-gradient(135deg, var(--c-pink), var(--c-blue));
  box-shadow: var(--shadow);
}
.friend-card:nth-child(2) .friend-avatar { background: linear-gradient(135deg, var(--c-purple), var(--c-green)); }
.friend-card:nth-child(3) .friend-avatar { background: linear-gradient(135deg, var(--c-orange), var(--c-yellow)); }
.friend-card:nth-child(4) .friend-avatar { background: linear-gradient(135deg, var(--c-blue), var(--c-purple)); }

/* Footer */
.footer { text-align: center; padding: 30px; color: var(--c-purple); font-weight: 600; }

/* Back to top */
.to-top {
  position: fixed; bottom: 24px; right: 24px; width: 50px; height: 50px;
  border-radius: 50%; border: none; background: var(--c-purple); color: #fff;
  font-size: 1.4rem; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; right: 14px; flex-direction: column;
    background: #fff; padding: 14px; border-radius: 18px; box-shadow: var(--shadow);
    transform: scale(.9); opacity: 0; pointer-events: none; transform-origin: top right; transition: all .25s;
  }
  .nav-links.open { transform: scale(1); opacity: 1; pointer-events: auto; }
}

/* Dark mode */
body.dark {
  --c-bg: #14121f;
  --c-text: #ece9f7;
  --c-card: #221d33;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
body.dark .navbar { background: rgba(30, 25, 47, 0.75); }
body.dark .nav-links a { color: var(--c-text); }
body.dark .chip,
body.dark .theme-toggle,
body.dark .skill-card,
body.dark .family-card,
body.dark .friend-card,
body.dark .music-card,
body.dark .fact,
body.dark .gallery-item { background: var(--c-card); }
body.dark .contact-form input,
body.dark .contact-form textarea { background: var(--c-card); border-color: #3a3357; color: var(--c-text); }
body.dark .bar { background: #322b4d; }
body.dark .blob { opacity: 0.3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
