:root{
  --bg:#0b0f17;
  --panel:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border: rgba(255,255,255,.12);
  --glow: 0 0 30px rgba(255,60,60,.22);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1000px 500px at 50% 0%, rgba(255,60,60,.15), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(60,140,255,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

/* Navbar */
.nav{
  position:sticky; top:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px;
  background: rgba(11,15,23,.65);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
  z-index:10;
}
.logo{font-weight:700; letter-spacing:.4px;}
.links a{
  color:var(--muted); text-decoration:none; margin:0 10px;
  transition:.2s;
}
.links a:hover{color:var(--text);}

/* Hero */
.hero{
  max-width: 980px;
  margin: 0 auto;
  padding: 70px 18px 20px;
  text-align:center;
  animation: fadeUp .8s ease both;
}
.badge{
  display:inline-block;
  padding:6px 12px;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--muted);
  font-size:14px;
}
.title{
  font-size: clamp(32px, 5vw, 56px);
  margin: 14px 0 8px;
  line-height:1.05;
}
.grad{
  background: linear-gradient(90deg, #ff6b6b, #f59e0b, #60a5fa);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.subtitle{
  color:var(--muted);
  max-width: 680px;
  margin: 0 auto 18px;
}

/* Buttons */
.btn{
  display:inline-block;
  padding:10px 16px;
  border-radius: 12px;
  text-decoration:none;
  border:1px solid var(--border);
  color:var(--text);
  background: rgba(255,255,255,.04);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: var(--glow); }
.btn-primary{
  background: linear-gradient(90deg, rgba(255,70,70,.9), rgba(245,158,11,.8));
  border: none;
  color:#ffffff;
  font-weight:700;
}
.btn-outline{ background: rgba(255,255,255,.03); }
.cta{ display:flex; gap:12px; justify-content:center; margin: 18px 0; flex-wrap:wrap;}

/* Stats cards */
.stats{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
  margin-top: 18px;
}
.card{
  background: rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}
.cardNum{ font-size:28px; margin:0; font-weight:800; }
.cardTxt{ margin:6px 0 0; color:var(--muted); }

/* Sections */
.section{
  max-width: 980px;
  margin: 0 auto;
  padding: 46px 18px;
}
.section h2{
  margin:0 0 12px;
  font-size: 28px;
}
.section p{ color: var(--muted); line-height:1.7; }

/* Skills chips */
.chips{ display:flex; gap:10px; flex-wrap:wrap; }
.chip{
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(255,255,255,.03);
  color: var(--text);
}

/* Projects */
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
.proj{
  background: rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.proj:hover{ transform: translateY(-4px); box-shadow: var(--glow); }
.proj p{ margin:8px 0 12px; }
.projBtns{ display:flex; gap:10px; flex-wrap:wrap; }

/* Contact */
.muted{ color: var(--muted); }
.contactBox{ display:flex; gap:12px; flex-wrap:wrap; margin-top: 10px; }

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

/* Responsive */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  .stats{ grid-template-columns: 1fr; }
  .links{ display:none; } /* পরে hamburger menu করব */
}

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(12px); }
  to{ opacity:1; transform: translateY(0); }
}

.typing{
  margin-top: 10px;
  color: #cfcfcf;
  font-size: 16px;
}

.cursor{
  animation: blink 0.7s infinite;
}

@keyframes blink{
  0%,100%{opacity: 1;}
  50%{opacity: 0;}
}

#particles-js{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.projects-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.project-card{
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 18px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  transition: 0.3s;
}

.project-card:hover{
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.25);
}

.project-btns{
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.btn{
  padding: 8px 14px;
  background: #ff5c2a;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
}

.btn-outline{
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
}

.disabled{
  opacity: 0.4;
  pointer-events: none;
}

.github-stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:20px;
  margin-top:20px;
}

.github-stats-grid img{
  width:100%;
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.12);
}

/* Version 2: Four Swords Clash + Shield Intro */
#intro-forge{
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(120, 90, 50, 0.06), transparent 35%),
    #070b12;
  z-index: 99999;
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-forge.hide{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sword{
  position: absolute;
  width: 180px;
  height: 22px;
  transform-origin: center center;
  animation-duration: 1.1s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.05));
}

/* Blade */
.sword::before{
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 120px;
  height: 8px;
  background: linear-gradient(90deg, #c7cbd1, #7d848d);
  clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%);
  border-radius: 2px;
}

/* Guard + handle */
.sword::after{
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 58px;
  height: 22px;
  background:
    linear-gradient(90deg, #8a7451 0 24%, #2e3440 24% 72%, #6b5438 72% 100%);
  clip-path: polygon(0 35%, 28% 35%, 28% 0, 52% 0, 52% 35%, 100% 35%, 100% 65%, 52% 65%, 52% 100%, 28% 100%, 28% 65%, 0 65%);
  border-radius: 3px;
}

.sword-top-left{
  top: -40px;
  left: -70px;
  transform: rotate(45deg);
  animation-name: swordTLv2;
}

.sword-top-right{
  top: -40px;
  right: -70px;
  transform: rotate(135deg);
  animation-name: swordTRv2;
}

.sword-bottom-left{
  bottom: -40px;
  left: -70px;
  transform: rotate(-45deg);
  animation-name: swordBLv2;
}

.sword-bottom-right{
  bottom: -40px;
  right: -70px;
  transform: rotate(-135deg);
  animation-name: swordBRv2;
}

/* Clash effects */
.clash-flash{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,245,210,0.95) 0%, rgba(255,190,110,0.55) 45%, rgba(255,140,70,0.08) 75%, transparent 100%);
  opacity: 0;
  animation: clashFlash 0.38s ease-out forwards;
  animation-delay: 1.02s;
}

.clash-ring{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255,210,150,0.7);
  opacity: 0;
  animation: clashRing 0.55s ease-out forwards;
  animation-delay: 1.02s;
}

/* Shield */
.shield-wrap{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.shield{
  width: 0;
  height: 0;
  opacity: 0;
  background:
    linear-gradient(180deg, #8a7250 0%, #5d4b35 35%, #2d3440 100%);
  clip-path: polygon(50% 0%, 88% 16%, 88% 56%, 50% 100%, 12% 56%, 12% 16%);
  border: 2px solid rgba(220,195,150,0.25);
  box-shadow:
    inset 0 0 14px rgba(255,255,255,0.06),
    0 0 26px rgba(155,120,70,0.10);
  animation: shieldAppearV2 0.55s ease forwards;
  animation-delay: 1.25s;
}

@keyframes swordTLv2{
  0%{ top: -40px; left: -70px; }
  100%{ top: 44%; left: 43%; }
}

@keyframes swordTRv2{
  0%{ top: -40px; right: -70px; }
  100%{ top: 44%; right: 43%; }
}

@keyframes swordBLv2{
  0%{ bottom: -40px; left: -70px; }
  100%{ bottom: 44%; left: 43%; }
}

@keyframes swordBRv2{
  0%{ bottom: -40px; right: -70px; }
  100%{ bottom: 44%; right: 43%; }
}

@keyframes clashFlash{
  0%{
    width: 0;
    height: 0;
    opacity: 0;
  }
  40%{
    width: 42px;
    height: 42px;
    opacity: 1;
  }
  100%{
    width: 90px;
    height: 90px;
    opacity: 0;
  }
}

@keyframes clashRing{
  0%{
    width: 0;
    height: 0;
    opacity: 0;
  }
  35%{
    opacity: 0.9;
  }
  100%{
    width: 140px;
    height: 140px;
    opacity: 0;
  }
}

@keyframes shieldAppearV2{
  0%{
    width: 0;
    height: 0;
    opacity: 0;
    transform: scale(0.7);
  }
  70%{
    width: 94px;
    height: 112px;
    opacity: 1;
    transform: scale(1.08);
  }
  100%{
    width: 86px;
    height: 102px;
    opacity: 1;
    transform: scale(1);
  }
}

#scorpion-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

