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

:root {
  --accent: #38bdf8;
  --accent2: #818cf8;
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #0d1b2e;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --card-border: rgba(56, 189, 248, 0.12);
  --glow: rgba(56, 189, 248, 0.25);
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ============================================================
   ANIMATED BACKGROUND BLOBS
   ============================================================ */
.bg-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blobFloat 12s ease-in-out infinite alternate;
}

.blob-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -150px; left: -150px;
  animation-duration: 10s;
}

.blob-2 {
  width: 400px; height: 400px;
  background: var(--accent2);
  bottom: -100px; right: -100px;
  animation-duration: 14s;
  animation-delay: -3s;
}

.blob-3 {
  width: 300px; height: 300px;
  background: #f472b6;
  top: 50%; left: 50%;
  animation-duration: 18s;
  animation-delay: -7s;
}

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -40px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  width: 100%;
  padding: 18px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
  z-index: 1000;
  transition: padding 0.4s ease, background 0.4s ease;
}

.navbar.scrolled {
  padding: 12px 80px;
  background: rgba(15, 23, 42, 0.95);
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.35s ease;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.nav-links a.active { color: var(--accent); }
.nav-links a.active::after { width: 100%; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 26px; height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.35s ease;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 80px;
  position: relative;
  z-index: 1;
}

.hero-content { max-width: 700px; }

.profile-ring {
  width: 120px; height: 120px;
  margin: 0 auto 28px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(var(--accent), var(--accent2), #f472b6, var(--accent));
  position: relative;
}

.profile-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-content h1 span { color: var(--accent); }

.hero-content h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 18px;
  min-height: 2em;
}

.cursor {
  animation: blink 0.8s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-content p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 28px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  padding: 13px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.35s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0f172a;
  box-shadow: 0 0 20px var(--glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.5);
}

.btn-secondary {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 0 20px var(--glow);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat p {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator span {
  display: block;
  width: 22px; height: 36px;
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  position: relative;
}

.scroll-indicator span::before {
  content: '';
  position: absolute;
  top: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { top: 5px; opacity: 1; }
  80%       { top: 18px; opacity: 0.2; }
}

/* ============================================================
   SECTIONS COMMON
   ============================================================ */
.section {
  padding: 110px 80px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 50px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
}

.section h2 span { color: var(--accent); }

.dark { background: var(--bg2); }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: flex;
  gap: 60px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: left;
  max-width: 960px;
  margin: 0 auto;
}

.about-image-wrap {
  position: relative;
  flex-shrink: 0;
}

.about-image {
  width: 200px; height: 200px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  padding: 4px;
  animation: float 4s ease-in-out infinite;
}

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

.about-avatar {
  width: 100%; height: 100%;
  border-radius: 20px;
  background: var(--bg2);
  overflow: hidden;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

.about-badge {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: #4ade80;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

.about-text { max-width: 480px; }

.about-text h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.about-text h2::after { display: none; }

.about-text h2 span { color: var(--accent); }

.about-text p { color: var(--muted); margin-bottom: 24px; }

.about-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.about-tags span {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-tags span i { color: var(--accent); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.skill-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--card-border);
  padding: 36px 30px;
  border-radius: var(--radius);
  width: 280px;
  max-width: 100%;
  text-align: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  backdrop-filter: blur(10px);
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px var(--glow);
  border-color: rgba(56, 189, 248, 0.4);
}

.skill-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(129,140,248,0.15));
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.3s;
}

.skill-card:hover .skill-icon {
  transform: rotate(10deg) scale(1.1);
}

.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.skill-tags span {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 16px;
  align-items: stretch;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.project-card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 100%;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(56,189,248,0.25);
}

.project-img {
  width: 100%;
  height: 230px;
  background: var(--card-gradient);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.03);
}

/* Fallback icon shown when no img loads */
.project-img .project-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.project-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.15);
  transition: background 0.3s;
  z-index: 2;
}

.project-card:hover .project-img-overlay {
  background: rgba(15,23,42,0.04);
}

.project-icon {
  font-size: 3.2rem;
  color: rgba(255, 255, 255, 0.85);
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  transition: transform 0.4s ease;
}

.project-card:hover .project-icon {
  transform: translate(-50%, -50%) scale(1.12) rotate(-5deg);
}

.project-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
  margin-bottom: 6px;
}

.project-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.project-body p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-tags span {
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: var(--accent2);
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.74rem;
  font-weight: 600;
}

.project-links {
  display: flex;
  gap: 14px;
}

.project-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.project-links a:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
}

.project-links .live-link {
  color: var(--accent2);
  border-color: rgba(129,140,248,0.2);
}

.project-links .live-link:hover {
  background: rgba(129,140,248,0.1);
  border-color: var(--accent2);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-sub {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 1rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 28px;
  border: 1px solid var(--card-border);
  border-radius: 50px;
  margin-bottom: 36px;
  transition: all 0.3s;
  background: rgba(56,189,248,0.04);
}

.contact-email:hover {
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 30px var(--glow);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(30,41,59,0.5);
  transition: all 0.35s ease;
}

.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--glow);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 28px;
  text-align: center;
  background: var(--bg3);
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--card-border);
  position: relative;
  z-index: 1;
}

footer span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large desktop — constrain projects section width */
@media (min-width: 1400px) {
  .section { padding: 110px 120px; }
}

/* Medium desktop */
@media (max-width: 1200px) {
  .navbar { padding: 18px 40px; }
  .navbar.scrolled { padding: 12px 40px; }
  .section { padding: 100px 40px; }
}

/* Tablet landscape */
@media (max-width: 1024px) {
  .hero-content h1 { font-size: 2.4rem; }
  .skills-grid { gap: 18px; }
  .skill-card { width: 220px; }
}

/* Tablet portrait / large phones */
@media (max-width: 768px) {
  /* Navbar */
  .navbar { padding: 16px 24px; }
  .navbar.scrolled { padding: 12px 24px; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 20px;
    position: absolute;
    top: 64px; right: 0;
    background: rgba(15, 23, 42, 0.98);
    padding: 28px 32px;
    width: 230px;
    border-radius: 0 0 0 16px;
    border-left: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    z-index: 999;
  }

  .nav-links.open { display: flex; }
  .hamburger { display: flex; }

  /* Hero */
  .section { padding: 80px 24px; }
  .hero { padding: 100px 20px 70px; }
  .hero-content h1 { font-size: 2rem; }
  .hero-content h3 { font-size: 1.1rem; }
  .hero-content p { font-size: 0.95rem; }
  .profile-ring { width: 100px; height: 100px; }
  .hero-stats { gap: 24px; }
  .stat { font-size: 1.6rem; }

  /* About */
  .about-grid { flex-direction: column; text-align: center; gap: 40px; }
  .about-tags { justify-content: center; }
  .about-text { max-width: 100%; }

  /* Skills */
  .skills-grid { gap: 16px; }
  .skill-card { width: calc(50% - 8px); min-width: 160px; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; gap: 20px; max-width: 560px; }

  /* Contact */
  .contact-email { font-size: 0.9rem; padding: 12px 20px; }
  .social-links { gap: 10px; }
  .social-btn { padding: 10px 18px; font-size: 0.85rem; }
}

/* Small phones */
@media (max-width: 576px) {
  .navbar { padding: 14px 18px; }

  .hero-content h1 { font-size: 1.75rem; }
  .hero-content p { font-size: 0.9rem; }
  .btn-primary, .btn-secondary { padding: 11px 20px; font-size: 0.88rem; }
  .hero-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .stat { font-size: 1.4rem; }

  /* Skills: 1 column */
  .skills-grid { flex-direction: column; align-items: center; }
  .skill-card { width: 100%; max-width: 340px; }

  /* Projects: 1 column */
  .projects-grid { grid-template-columns: 1fr; }

  /* About badge doesn't overflow */
  .about-badge { font-size: 0.72rem; padding: 5px 10px; }

  /* Section headings */
  .section h2 { font-size: 1.5rem; }
}

/* Extra small phones */
@media (max-width: 380px) {
  .hero-content h1 { font-size: 1.5rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .hero-stats { gap: 12px; }
  .stat { font-size: 1.2rem; }
  .logo { font-size: 1.3rem; }
}