:root {
  --bg: #0f172a;
  --bg-2: #111c33;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(79, 172, 254, 0.18);
  --cyan: #00f2fe;
  --blue: #4facfe;
  --purple: #8b5cf6;
  --text: #e6edf6;
  --muted: #94a3b8;
  --grad: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background decoration */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(79, 172, 254, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 172, 254, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}
.bg-glow {
  position: fixed; border-radius: 50%; filter: blur(120px);
  z-index: -2; opacity: 0.5;
}
.glow-1 { width: 400px; height: 400px; background: var(--blue); top: -100px; left: -100px; }
.glow-2 { width: 450px; height: 450px; background: var(--purple); bottom: -120px; right: -120px; }

/* Reusable */
.section { padding: 100px 8% 60px; }
.section-title {
  text-align: center; font-size: 2.6rem; font-weight: 700;
  margin-bottom: 50px;
}
.gradient-text {
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 40px; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  border: none;
}
.btn-primary {
  background: var(--grad); color: #06121f;
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.4);
}
.btn-primary:hover { transform: scale(1.06); box-shadow: 0 0 28px rgba(0, 242, 254, 0.7); }
.btn-ghost {
  background: transparent; color: var(--cyan);
  border: 1.5px solid var(--cyan);
}
.btn-ghost:hover { transform: scale(1.06); background: rgba(0, 242, 254, 0.1); box-shadow: var(--shadow-glow); }
.btn.small { padding: 9px 18px; font-size: 0.85rem; }
.btn.full { width: 100%; justify-content: center; }

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 8%; transition: all 0.3s ease;
}
.navbar.scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 8%;
}
.logo {
  font-size: 1.6rem; font-weight: 800; color: var(--text);
  text-decoration: none; letter-spacing: 0.5px;
}
.logo span { color: var(--cyan); }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  position: relative; transition: color 0.25s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--grad);
  transition: width 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.menu-toggle span {
  width: 26px; height: 3px; background: var(--cyan); border-radius: 3px;
  transition: all 0.3s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: space-between; gap: 40px; padding: 120px 8% 60px;
  flex-wrap: wrap;
}
.hero-content { flex: 1 1 480px; max-width: 640px; }
.hero-greeting { color: var(--muted); font-size: 1.2rem; font-weight: 500; }
.hero-name { font-size: 3.6rem; font-weight: 800; line-height: 1.1; margin: 6px 0; }
.hero-role { font-size: 1.7rem; font-weight: 600; margin-bottom: 18px; min-height: 2.2rem; }
.typed { color: var(--cyan); }
.cursor { color: var(--cyan); animation: blink 1s infinite; font-weight: 300; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-intro { color: var(--muted); font-size: 1.05rem; max-width: 540px; margin-bottom: 26px; }

.social-icons { display: flex; gap: 16px; margin-bottom: 28px; }
.social-icons a {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1.5px solid var(--border); border-radius: 50%;
  color: var(--cyan); font-size: 1.2rem; text-decoration: none;
  transition: all 0.3s ease; background: var(--card);
}
.social-icons a:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--shadow-glow);
  border-color: var(--cyan); color: #06121f; background: var(--grad);
}
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }

/* Profile ring */
.hero-image { flex: 1 1 320px; display: grid; place-items: center; }
.profile-ring {
  width: 320px; height: 320px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(from 0deg, var(--cyan), var(--purple), var(--blue), var(--cyan));
  animation: spin 6s linear infinite;
  box-shadow: 0 0 40px rgba(0, 242, 254, 0.4);
}
@keyframes spin { to { transform: rotate(360deg); } }
.profile-inner {
  width: 290px; height: 290px; border-radius: 50%;
  background: var(--bg-2); display: grid; place-items: center;
  animation: spin 6s linear infinite reverse;
}
.profile-inner i { font-size: 7rem; color: var(--cyan); filter: drop-shadow(0 0 14px var(--cyan)); }

/* About */
.about-wrap { display: flex; gap: 50px; align-items: center; flex-wrap: wrap; }
.about-visual { flex: 1 1 300px; display: grid; place-items: center; }
.about-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 50px 40px; text-align: center;
  backdrop-filter: blur(8px); box-shadow: var(--shadow-glow);
  transition: transform 0.3s ease;
}
.about-card:hover { transform: translateY(-8px); }
.about-card i { font-size: 3.5rem; color: var(--cyan); margin-bottom: 16px; }
.about-card h4 { font-size: 1.4rem; }
.about-card p { color: var(--muted); }
.about-text { flex: 1 1 420px; }
.about-text h3 { font-size: 1.7rem; margin-bottom: 16px; }
.about-text p { color: var(--muted); margin-bottom: 14px; }
.about-stats { display: flex; gap: 30px; margin: 26px 0; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--cyan); }
.stat .label { color: var(--muted); font-size: 0.9rem; }

/* Skills */
.skills-columns { display: flex; gap: 40px; flex-wrap: wrap; }
.skill-group {
  flex: 1 1 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 34px; backdrop-filter: blur(8px);
}
.group-title { font-size: 1.3rem; margin-bottom: 26px; display: flex; align-items: center; gap: 10px; }
.group-title i { color: var(--cyan); }
.skill { margin-bottom: 22px; }
.skill-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 500; }
.skill-head .pct { color: var(--cyan); }
.bar { width: 100%; height: 9px; background: rgba(255,255,255,0.07); border-radius: 20px; overflow: hidden; }
.fill {
  width: 0; height: 100%; background: var(--grad); border-radius: 20px;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.6);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 30px; }
.project-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; overflow: hidden; backdrop-filter: blur(8px);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.project-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-glow); border-color: var(--cyan); }
.project-top {
  height: 150px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(79,172,254,0.15), rgba(139,92,246,0.15));
  font-size: 3.2rem; color: var(--cyan);
}
.project-body { padding: 26px; }
.project-body h4 { font-size: 1.3rem; margin-bottom: 10px; }
.project-body p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tags span {
  font-size: 0.75rem; padding: 4px 12px; border-radius: 20px;
  background: rgba(0, 242, 254, 0.1); color: var(--cyan);
  border: 1px solid var(--border);
}

/* Contact */
.contact-sub { text-align: center; color: var(--muted); margin-top: -30px; margin-bottom: 45px; }
.contact-wrap { display: flex; gap: 40px; flex-wrap: wrap; }
.contact-form { flex: 1 1 460px; }
.field { position: relative; margin-bottom: 26px; }
.field input, .field textarea {
  width: 100%; padding: 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: inherit; font-size: 1rem;
  resize: vertical; transition: border 0.25s ease, box-shadow 0.25s ease;
}
.field textarea { min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: var(--shadow-glow);
}
.field label {
  position: absolute; top: 16px; left: 16px; color: var(--muted);
  pointer-events: none; transition: all 0.2s ease; background: var(--bg);
  padding: 0 6px;
}
.field input:focus + label, .field input:valid + label,
.field textarea:focus + label, .field textarea:valid + label {
  top: -10px; left: 12px; font-size: 0.8rem; color: var(--cyan);
}
.form-note { margin-top: 14px; text-align: center; font-weight: 500; }

.contact-direct { flex: 1 1 300px; display: flex; flex-direction: column; gap: 18px; }
.direct-item {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; text-decoration: none; color: var(--text);
  transition: all 0.3s ease;
}
.direct-item:hover { transform: translateX(8px); border-color: var(--cyan); box-shadow: var(--shadow-glow); }
.direct-item i { font-size: 1.6rem; color: var(--cyan); width: 40px; text-align: center; }
.direct-item span { display: block; font-weight: 600; }
.direct-item small { color: var(--muted); }

/* Footer */
.footer { text-align: center; padding: 30px 8%; color: var(--muted); border-top: 1px solid var(--border); }
.footer strong { color: var(--text); }

/* Back to top */
.to-top {
  position: fixed; bottom: 28px; right: 28px; width: 48px; height: 48px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--grad); color: #06121f; text-decoration: none;
  box-shadow: var(--shadow-glow); opacity: 0; pointer-events: none;
  transform: translateY(20px); transition: all 0.35s ease; z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { transform: scale(1.12); }

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

/* Responsive */
@media (max-width: 900px) {
  .hero-name { font-size: 2.8rem; }
  .section-title { font-size: 2.1rem; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 70%;
    max-width: 300px; flex-direction: column; justify-content: center;
    align-items: center; gap: 36px; background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(14px); border-left: 1px solid var(--border);
    transition: right 0.4s ease;
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1.2rem; }
  .hero { text-align: center; padding-top: 110px; }
  .hero-content { max-width: 100%; }
  .social-icons, .hero-btns { justify-content: center; }
  .hero-intro { margin-left: auto; margin-right: auto; }
  .about-stats { justify-content: center; }
  .profile-ring { width: 250px; height: 250px; }
  .profile-inner { width: 224px; height: 224px; }
}
@media (max-width: 480px) {
  .section { padding: 80px 6% 50px; }
  .hero-name { font-size: 2.3rem; }
  .hero-role { font-size: 1.3rem; }
  .skill-group, .about-card { padding: 26px; }
}
/* ===== Live Tools & APIs ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  backdrop-filter: blur(8px);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
  border-color: var(--cyan);
}
.tool-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.tool-head i {
  font-size: 1.8rem; color: var(--cyan);
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.4));
}
.tool-head h4 { font-size: 1.2rem; }
.tool-head span { color: var(--muted); font-size: 0.85rem; }

.tool-input {
  width: 100%; padding: 14px 16px; margin-bottom: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  resize: vertical; transition: border 0.25s ease, box-shadow 0.25s ease;
}
.tool-input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--shadow-glow); }
.tool-input::placeholder { color: #5b6b85; }

/* file drop */
.file-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px; margin-bottom: 14px; cursor: pointer; text-align: center;
  border: 1.5px dashed var(--border); border-radius: 12px;
  color: var(--muted); transition: all 0.25s ease;
  background: rgba(15, 23, 42, 0.4);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--cyan); color: var(--cyan);
  box-shadow: var(--shadow-glow); background: rgba(0, 242, 254, 0.05);
}
.file-drop i { font-size: 1.8rem; color: var(--cyan); }

/* output */
.tool-output {
  margin-top: 16px; font-size: 0.9rem; color: var(--muted);
  display: none;
}
.tool-output.active { display: block; }
.tool-output .loading { display: flex; align-items: center; gap: 10px; color: var(--cyan); }
.tool-output .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(0, 242, 254, 0.25); border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
.tool-output .err { color: #f87171; }
.tool-output .ok { color: #34d399; }

.out-media { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.out-media img {
  width: 70px; height: 70px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--border);
}
.out-media .meta-title { color: var(--text); font-weight: 600; }
.out-media .meta-sub { color: var(--muted); font-size: 0.82rem; }

.out-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.out-stats span {
  font-size: 0.78rem; padding: 5px 12px; border-radius: 20px;
  background: rgba(0, 242, 254, 0.08); color: var(--cyan);
  border: 1px solid var(--border);
}
.out-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.ai-reply {
  background: rgba(15, 23, 42, 0.6); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; color: var(--text);
  white-space: pre-wrap; line-height: 1.55;
}

.search-item {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px;
}
.search-item img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.search-item .si-title { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.search-item .si-sub { color: var(--muted); font-size: 0.78rem; }
.search-item .btn { margin-left: auto; }
