/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #6c63ff;
  --primary-dark: #4f46e5;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg-dark: #0a0a1a;
  --bg-card: rgba(255,255,255,0.06);
  --bg-card-hover: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.12);
  --text-primary: #f0f0ff;
  --text-secondary: rgba(240,240,255,0.65);
  --text-muted: rgba(240,240,255,0.4);
  --glow: 0 0 40px rgba(108,99,255,0.25);
  --transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: "Inter", sans-serif; background: var(--bg-dark); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; position: relative; }

/* BACKGROUND */
.bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-canvas::before { content: ""; position: absolute; width: 700px; height: 700px; background: radial-gradient(circle, rgba(108,99,255,0.18) 0%, transparent 70%); top: -200px; left: -200px; animation: floatOrb1 15s ease-in-out infinite; }
.bg-canvas::after { content: ""; position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, rgba(6,182,212,0.14) 0%, transparent 70%); bottom: -150px; right: -150px; animation: floatOrb2 18s ease-in-out infinite; }
.bg-orb3 { position: absolute; width: 400px; height: 400px; background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: floatOrb3 22s ease-in-out infinite; }
@keyframes floatOrb1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(80px,60px) scale(1.15); } }
@keyframes floatOrb2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px,-50px) scale(1.1); } }
@keyframes floatOrb3 { 0%,100% { transform: translate(-50%,-50%) scale(1); } 33% { transform: translate(-40%,-60%) scale(1.2); } 66% { transform: translate(-60%,-40%) scale(0.9); } }
.bg-grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 40px 40px; }

/* LAYOUT */
.container { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

/* EDIT FAB */
.edit-fab { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; box-shadow: 0 8px 32px rgba(108,99,255,0.45); transition: var(--transition); }
.edit-fab:hover { transform: scale(1.1) rotate(15deg); box-shadow: 0 12px 40px rgba(108,99,255,0.6); }
.edit-fab.active { background: linear-gradient(135deg, var(--success), #059669); animation: pulse-fab 2s infinite; }
@keyframes pulse-fab { 0%,100% { box-shadow: 0 8px 32px rgba(16,185,129,0.45); } 50% { box-shadow: 0 8px 32px rgba(16,185,129,0.8); } }

/* EDIT BANNER */
.edit-banner { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 999; background: linear-gradient(90deg, var(--success), #059669); color: #fff; text-align: center; padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; }
.edit-banner.show { display: block; }

/* EDITABLE */
body.edit-mode [data-editable] { outline: 2px dashed rgba(108,99,255,0.5); border-radius: 6px; cursor: text; padding: 2px 4px; min-width: 20px; min-height: 1em; }
body.edit-mode [data-editable]:hover { outline-color: var(--primary); background: rgba(108,99,255,0.08); }
body.edit-mode [data-editable]:focus { outline: 2px solid var(--primary); background: rgba(108,99,255,0.12); }

/* HERO */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3.5rem 0 2.5rem; }

/* AVATAR */
.avatar-wrapper { position: relative; margin-bottom: 2rem; }
.avatar-ring { position: absolute; inset: -8px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)); animation: spinRing 6s linear infinite; z-index: 0; }
.avatar-ring-inner { position: absolute; inset: -4px; border-radius: 50%; background: var(--bg-dark); z-index: 1; }
@keyframes spinRing { to { transform: rotate(360deg); } }
.avatar { position: relative; z-index: 2; width: 140px; height: 140px; border-radius: 50%; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-overlay { position: absolute; inset: 0; background: rgba(108,99,255,0.75); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; border-radius: 50%; flex-direction: column; gap: 4px; }
.avatar:hover .avatar-overlay { opacity: 1; }
.avatar-overlay i { font-size: 1.5rem; color: #fff; }
.avatar-overlay span { font-size: 0.7rem; color: #fff; font-weight: 600; }
#photo-input { display: none; }
.status-badge { position: absolute; bottom: 4px; right: 4px; z-index: 3; width: 20px; height: 20px; border-radius: 50%; background: var(--success); border: 3px solid var(--bg-dark); animation: statusPulse 2s infinite; }
@keyframes statusPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }

/* HERO TEXT */
.hero-name { font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem,6vw,3.2rem); font-weight: 800; background: linear-gradient(135deg, #fff 30%, var(--primary) 70%, var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.15; margin-bottom: 0.5rem; }
.hero-tagline { font-size: clamp(0.95rem,2.5vw,1.15rem); color: var(--secondary); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 0.4rem; }
.hero-school { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.07); border: 1px solid var(--border); border-radius: 100px; padding: 0.45rem 1.1rem; font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 1.2rem; }
.hero-school i { color: var(--accent); }
.hero-bio { max-width: 560px; font-size: 0.97rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 2rem; }

/* CONTACT PILLS */
.contact-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1rem; }
.pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 1rem; border-radius: 100px; font-size: 0.83rem; font-weight: 500; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: var(--transition); text-decoration: none; }
.pill:hover { background: var(--bg-card-hover); border-color: var(--primary); color: var(--text-primary); }
.pill i { color: var(--primary); }
.pill.email i { color: var(--secondary); }
.pill.wa i { color: var(--success); }
.pill.ig i { color: #e1306c; }
.pill.yt i { color: #ff0000; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin: 2rem 0; width: 100%; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem 1rem; text-align: center; transition: var(--transition); }
.stat-card:hover { background: var(--bg-card-hover); border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--glow); }
.stat-number { font-family: "Space Grotesk", sans-serif; font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }

/* SECTION */
.section { margin-top: 3rem; width: 100%; }
.section-title { display: flex; align-items: center; gap: 0.75rem; font-family: "Space Grotesk", sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.25rem; }
.section-title .line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.section-title .icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; color: #fff; flex-shrink: 0; }

/* SKILLS */
.skills-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.skill-tag { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 1rem; border-radius: 100px; font-size: 0.83rem; font-weight: 500; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); transition: var(--transition); position: relative; }
.skill-tag:hover { background: rgba(108,99,255,0.15); border-color: var(--primary); color: var(--text-primary); transform: translateY(-2px); }
body.edit-mode .skill-tag .remove-btn { display: flex; }
.skill-tag .remove-btn { display: none; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 0.6rem; cursor: pointer; border: none; margin-left: 2px; }
.add-skill-btn { display: none; align-items: center; gap: 0.4rem; padding: 0.45rem 1rem; border-radius: 100px; font-size: 0.83rem; font-weight: 500; border: 1px dashed var(--primary); background: transparent; color: var(--primary); cursor: pointer; transition: var(--transition); }
body.edit-mode .add-skill-btn { display: inline-flex; }
.add-skill-btn:hover { background: rgba(108,99,255,0.1); }

/* LINK CARDS */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }
.link-card { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text-primary); transition: var(--transition); cursor: pointer; overflow: hidden; }
.link-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 60%, rgba(108,99,255,0.06)); opacity: 0; transition: opacity 0.35s; }
.link-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 40px rgba(108,99,255,0.2); }
.link-card:hover::before { opacity: 1; }
.link-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.link-info { flex: 1; min-width: 0; }
.link-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-arrow { color: var(--text-muted); font-size: 0.9rem; transition: var(--transition); }
.link-card:hover .link-arrow { color: var(--primary); transform: translateX(3px); }
.link-card-actions { display: none; position: absolute; top: 6px; right: 6px; gap: 4px; }
body.edit-mode .link-card-actions { display: flex; }
.link-card-action-btn { width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.link-card-action-btn:hover { transform: scale(1.15); }
.btn-edit-link { background: var(--primary); color: #fff; }
.btn-delete-link { background: var(--danger); color: #fff; }
.add-link-card { display: none; align-items: center; justify-content: center; gap: 0.6rem; padding: 1.1rem 1.25rem; background: transparent; border: 2px dashed rgba(108,99,255,0.4); border-radius: 16px; color: var(--primary); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition); margin-top: 1rem; width: 100%; }
body.edit-mode .add-link-card { display: flex; }
.add-link-card:hover { background: rgba(108,99,255,0.08); border-color: var(--primary); }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.modal-overlay.show { display: flex; }
.modal { background: #16162a; border: 1px solid var(--border); border-radius: 20px; padding: 2rem; width: 100%; max-width: 460px; animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; color: var(--text-primary); font-family: "Inter", sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--primary); }
.modal-btns { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn-primary { flex: 1; padding: 0.75rem; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-cancel { flex: 1; padding: 0.75rem; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.btn-cancel:hover { background: var(--bg-card); }
.icon-preview { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; background: var(--primary); color: #fff; margin-bottom: 0.5rem; }
.color-swatch { display: inline-block; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s; }
.color-swatch:hover, .color-swatch.selected { border-color: #fff; transform: scale(1.2); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* FOOTER */
.footer { text-align: center; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem; }
.footer strong { color: var(--text-secondary); }

/* PARTICLES */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.particle { position: absolute; border-radius: 50%; animation: floatParticle linear infinite; opacity: 0; }
@keyframes floatParticle { 0% { transform: translateY(100vh) scale(0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 0.5; } 100% { transform: translateY(-10vh) scale(1); opacity: 0; } }

/* TOAST */
.toast { position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--success); color: #fff; padding: 0.7rem 1.5rem; border-radius: 100px; font-size: 0.85rem; font-weight: 600; z-index: 3000; opacity: 0; transition: all 0.3s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .stats-grid { gap: 0.6rem; }
  .stat-card { padding: 1rem 0.5rem; }
  .stat-number { font-size: 1.4rem; }
  .links-grid { grid-template-columns: 1fr; }
  .edit-fab { bottom: 1.25rem; right: 1.25rem; width: 50px; height: 50px; font-size: 1.1rem; }
  .container { padding: 1.5rem 1rem 4rem; }
}
@media (max-width: 400px) {
  .contact-pills { gap: 0.4rem; }
  .pill { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
  .hero-bio { font-size: 0.9rem; }
}
