/* ===================================================
   মো. মেহেদী হাসান — বাংলা পোর্টফোলিও
   Modern Dark Theme + 3D Animations
   =================================================== */

/* ===== CSS VARIABLES ===== */
:root {
  --bg:            #0d1117;
  --bg-alt:        rgba(22, 27, 34, 0.6);
  --bg-card:       rgba(22, 27, 34, 0.9);
  --border:        rgba(48, 54, 61, 0.8);
  --border-light:  rgba(88, 166, 255, 0.3);
  --primary:       #58a6ff;
  --primary-dark:  #1f6feb;
  --accent:        #bc8cff;
  --teal:          #3fb950;
  --text:          #e6edf3;
  --text-muted:    #8b949e;
  --gradient:      linear-gradient(135deg, #58a6ff 0%, #bc8cff 100%);
  --font:          'Hind Siliguri', sans-serif;
  --radius:        14px;
  --transition:    0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

img  { display: block; max-width: 100%; }
a    { text-decoration: none; color: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--primary-dark); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== CONTAINER ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===================================================
   ANIMATED BACKGROUND ORBS (3D depth effect)
   =================================================== */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.12), transparent 70%);
  top: -100px;
  left: -100px;
  animation: orb-drift-1 18s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(188, 140, 255, 0.1), transparent 70%);
  bottom: 10%;
  right: -80px;
  animation: orb-drift-2 22s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(63, 185, 80, 0.07), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-drift-3 26s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0)   scale(1);    }
  33%       { transform: translate(60px, 80px)  scale(1.1); }
  66%       { transform: translate(-40px, 40px) scale(0.95); }
}
@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0)    scale(1);    }
  40%       { transform: translate(-70px, -50px) scale(1.08); }
  70%       { transform: translate(30px, 60px)   scale(0.9); }
}
@keyframes orb-drift-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    }
  50%       { transform: translate(-50%, -50%) scale(1.3); }
}

/* ===================================================
   NAVBAR
   =================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0.9rem 2rem;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%;   }
  50%       { background-position: 100% 50%; }
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  margin-left: 0.5rem;
  padding: 0.45rem 1.2rem;
  background: var(--gradient);
  color: #fff;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
}

.nav-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================
   HERO
   =================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6.5rem 1.5rem 4rem;
  z-index: 1;
}

.hero-content { flex: 1; min-width: 0; }

.hero-greeting {
  display: inline-block;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 50px;
  background: rgba(88, 166, 255, 0.06);
  animation: fade-up 0.6s ease both;
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  background: var(--gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  animation: fade-up 0.6s 0.1s ease both, gradient-shift 6s ease infinite;
}

.hero-title {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1.1rem;
  animation: fade-up 0.6s 0.2s ease both;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 460px;
  margin-bottom: 2rem;
  animation: fade-up 0.6s 0.3s ease both;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fade-up 0.6s 0.4s ease both;
}

/* 3D floating avatar */
.hero-image { flex-shrink: 0; }

.image-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  animation: float-3d 7s ease-in-out infinite;
  animation-delay: 0.5s;
  will-change: transform;
}

@keyframes float-3d {
  0%   { transform: translateY(0)    rotateY(0deg)   rotateX(0deg); }
  25%  { transform: translateY(-14px) rotateY(4deg)  rotateX(2deg); }
  50%  { transform: translateY(-8px)  rotateY(0deg)  rotateX(-1deg); }
  75%  { transform: translateY(-18px) rotateY(-4deg) rotateX(2deg); }
  100% { transform: translateY(0)    rotateY(0deg)   rotateX(0deg); }
}

.image-wrapper::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--gradient);
  z-index: -1;
}

.image-wrapper::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0.18;
  filter: blur(12px);
  animation: glow-pulse 3s ease-in-out infinite;
  z-index: -2;
}

@keyframes glow-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.18; }
  50%       { transform: scale(1.08); opacity: 0.08; }
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}

/* Scroll hint */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-dot {
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  animation: scroll-anim 2s ease-in-out infinite;
}

@keyframes scroll-anim {
  0%   { transform: translateY(0);    opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* Fade-up keyframe */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  background-size: 200% 200%;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(88, 166, 255, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  background: rgba(88, 166, 255, 0.05);
  box-shadow: 0 8px 25px rgba(88, 166, 255, 0.15);
}

.btn-full { width: 100%; justify-content: center; }

/* ===================================================
   SECTION COMMON
   =================================================== */
.section {
  padding: 5.5rem 0;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 55px;
  height: 3px;
  background: var(--gradient);
  margin: 0.7rem auto 0;
  border-radius: 2px;
}

.highlight {
  background: var(--gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

/* ===================================================
   ABOUT
   =================================================== */
.about-section {
  background: var(--bg-alt);
  border-top:    1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.85;
}

.mt-4 { margin-top: 1rem; }

.text-link {
  color: var(--primary);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.text-link:hover { border-color: var(--primary); }

.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.stat { display: flex; flex-direction: column; align-items: center; }

.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  animation: gradient-shift 6s ease infinite;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-align: center;
}

.skills-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.skill-tag {
  padding: 0.35rem 0.9rem;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.22);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: default;
  transition: all var(--transition);
  transform-style: preserve-3d;
}

.skill-tag:hover {
  background: rgba(88, 166, 255, 0.18);
  transform: translateY(-3px) translateZ(6px) scale(1.05);
  box-shadow: 0 6px 18px rgba(88, 166, 255, 0.2);
}

/* ===================================================
   PROJECTS
   =================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  perspective: 1200px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
  will-change: transform;
  /* JS controls the transform; CSS transition smooths it */
  transition: transform 0.08s ease, border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 28px 55px rgba(0, 0, 0, 0.5);
}

/* Colored top band */
.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
  overflow: hidden;
}

.project-card-top--blue   { background: linear-gradient(135deg, rgba(88,166,255,0.18), rgba(88,166,255,0.06));   border-bottom: 1px solid rgba(88,166,255,0.2);   }
.project-card-top--purple { background: linear-gradient(135deg, rgba(188,140,255,0.18), rgba(188,140,255,0.06)); border-bottom: 1px solid rgba(188,140,255,0.2); }
.project-card-top--teal   { background: linear-gradient(135deg, rgba(63,185,80,0.18), rgba(63,185,80,0.06));     border-bottom: 1px solid rgba(63,185,80,0.2);   }

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.project-card-top--blue   .project-icon { background: rgba(88,166,255,0.15);  color: var(--primary); }
.project-card-top--purple .project-icon { background: rgba(188,140,255,0.15); color: var(--accent);  }
.project-card-top--teal   .project-icon { background: rgba(63,185,80,0.15);   color: var(--teal);   }

.project-num {
  font-size: 1.8rem;
  font-weight: 700;
  opacity: 0.15;
  letter-spacing: -0.02em;
  line-height: 1;
}

.project-info {
  padding: 1.3rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-info h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.project-tags span {
  padding: 0.2rem 0.65rem;
  background: rgba(188, 140, 255, 0.08);
  border: 1px solid rgba(188, 140, 255, 0.22);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 1rem;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.project-link:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  color: var(--primary);
  transform: translateY(-2px);
}

.project-link--live:hover {
  background: rgba(63, 185, 80, 0.1);
  border-color: rgba(63, 185, 80, 0.3);
  color: var(--teal);
}

/* ===================================================
   CONTACT
   =================================================== */
.contact-section {
  background: var(--bg-alt);
  border-top:    1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
}

.contact-info > p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 1.8rem;
  line-height: 1.75;
}

.contact-links { display: flex; flex-direction: column; gap: 0.9rem; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text-muted);
  font-size: 0.93rem;
  transition: color var(--transition);
}

.contact-item:hover { color: var(--text); }

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all var(--transition);
}

.contact-item:hover .contact-icon {
  background: rgba(88, 166, 255, 0.18);
  transform: scale(1.1) translateZ(4px);
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.2);
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.form-group textarea { min-height: 130px; }

.form-success {
  display: none;
  text-align: center;
  color: var(--teal);
  font-size: 0.9rem;
  padding: 0.6rem;
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 8px;
  background: rgba(63, 185, 80, 0.07);
}

.form-success.show { display: block; }

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  background: rgba(13, 17, 23, 0.95);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p { color: var(--text-muted); font-size: 0.88rem; }

.footer-links { display: flex; gap: 1rem; }

.footer-links a {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition), transform var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateY(-3px) scale(1.15);
}

/* ===================================================
   SCROLL REVEAL (3D entrance)
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px) translateZ(-30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
  .about-grid   { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding: 7rem 1.5rem 4rem;
    gap: 2rem;
  }

  .hero-desc   { margin: 0 auto 2rem; }
  .hero-btns   { justify-content: center; }
  .image-wrapper { width: 210px; height: 210px; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem 1.5rem 1.5rem;
    gap: 0.2rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }
  .nav-cta { margin-left: 0; margin-top: 0.5rem; align-self: flex-start; }

  .footer-inner { justify-content: center; text-align: center; }
  .scroll-indicator { display: none; }
}

@media (max-width: 500px) {
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats   { gap: 1.2rem; }
}
