/* ===========================================================
   Design tokens
   =========================================================== */
:root {
  --bg: #e9edf3;
  --ink: #1e2530;
  --ink-muted: #565f6e;
  --ink-faint: #838d9c;
  --accent: #524fe0;
  --accent-strong: #4340c9;
  --accent-soft: rgba(82, 79, 224, 0.1);
  --signal: #0fb88a;
  --signal-soft: rgba(15, 184, 138, 0.12);

  --shadow-d: rgba(163, 173, 194, 0.65);
  --shadow-l: rgba(255, 255, 255, 0.85);

  --font-display: "Space Grotesk", "Noto Sans Bengali", sans-serif;
  --font-body: "IBM Plex Sans", "Noto Sans Bengali", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(30, 37, 48, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ===========================================================
   Utilities
   =========================================================== */
.container { max-width: 1152px; margin: 0 auto; width: 100%; padding: 0 24px; }
.container-sm { max-width: 896px; }
.container-xs { max-width: 640px; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-muted); }
.text-muted-light { color: rgba(86, 95, 110, 0.6); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.leading-relaxed { line-height: 1.8; }

/* ===========================================================
   Neumorphic shadows
   =========================================================== */
.shadow-extruded { box-shadow: 8px 8px 18px var(--shadow-d), -8px -8px 18px var(--shadow-l); }
.shadow-inset { box-shadow: inset 5px 5px 10px var(--shadow-d), inset -5px -5px 10px var(--shadow-l); }

/* ===========================================================
   Section scaffolding
   =========================================================== */
.section { padding: 112px 24px; }

.section-head { margin-bottom: 52px; }
.section-head.text-center { display: flex; flex-direction: column; align-items: center; }

.section-heading {
  font-size: clamp(1.5rem, 2.2vw + 0.9rem, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ===========================================================
   Buttons
   =========================================================== */
.btn-neu,
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}

.btn-neu {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 7px 7px 14px var(--shadow-d), -7px -7px 14px var(--shadow-l);
}
.btn-neu:hover {
  box-shadow: 10px 10px 18px var(--shadow-d), -10px -10px 18px var(--shadow-l);
  transform: translateY(-2px);
}
.btn-neu:active {
  transform: translateY(1px);
  box-shadow: inset 4px 4px 8px var(--shadow-d), inset -4px -4px 8px var(--shadow-l);
}

.btn-accent {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 7px 7px 14px var(--shadow-d), -4px -4px 10px var(--shadow-l), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-accent:hover {
  box-shadow: 10px 10px 20px rgba(82,79,224,0.35), -6px -6px 14px var(--shadow-l);
  transform: translateY(-2px);
}
.btn-accent:active {
  transform: translateY(1px);
  box-shadow: inset 3px 3px 8px rgba(0,0,0,0.25);
}

/* ===========================================================
   Card
   =========================================================== */
.card {
  background: var(--bg);
  border-radius: 26px;
  padding: 36px;
  box-shadow: 8px 8px 16px var(--shadow-d), -8px -8px 16px var(--shadow-l);
  border: 1px solid rgba(255,255,255,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  box-shadow: 11px 11px 22px var(--shadow-d), -11px -11px 22px var(--shadow-l);
  transform: translateY(-3px);
}

/* ===========================================================
   Tags
   =========================================================== */
.tag {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-d), inset -3px -3px 6px var(--shadow-l);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.tag.accent { color: var(--accent); }
.tag.teal { color: var(--signal); }
.tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ===========================================================
   Icon well
   =========================================================== */
.icon-well {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 6px 6px 12px var(--shadow-d), inset -6px -6px 12px var(--shadow-l);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ===========================================================
   Header
   =========================================================== */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  background: transparent;
}
#site-header.scrolled {
  background: rgba(233, 237, 243, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px var(--shadow-d);
}

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

.logo {
  height: 42px;
  padding: 0 18px;
  border-radius: 13px;
  background: var(--bg);
  box-shadow: 5px 5px 10px var(--shadow-d), -5px -5px 10px var(--shadow-l);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent);
}

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all 0.25s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--accent);
  box-shadow: inset 3px 3px 6px var(--shadow-d), inset -3px -3px 6px var(--shadow-l);
}

#menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--bg);
  box-shadow: 5px 5px 10px var(--shadow-d), -5px -5px 10px var(--shadow-l);
  border: none;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.25s ease;
}
#menu-toggle:active {
  box-shadow: inset 3px 3px 6px var(--shadow-d), inset -3px -3px 6px var(--shadow-l);
}

.mobile-menu {
  display: none;
  background: rgba(233, 237, 243, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px var(--shadow-d);
  padding: 0 24px 24px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 13px 16px;
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all 0.25s ease;
}
.mobile-menu a:hover {
  color: var(--ink);
  box-shadow: 5px 5px 10px var(--shadow-d), -5px -5px 10px var(--shadow-l);
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 112px 24px 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-content { display: flex; flex-direction: column; gap: 30px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 8px 16px 8px 12px;
  border-radius: 9999px;
  background: var(--bg);
  box-shadow: inset 3px 3px 6px var(--shadow-d), inset -3px -3px 6px var(--shadow-l);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-soft);
  flex-shrink: 0;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--signal-soft); }
  50% { box-shadow: 0 0 0 6px var(--signal-soft); }
}

.hero-headline {
  font-size: clamp(2rem, 4vw + 0.9rem, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--ink-muted);
  line-height: 1.75;
  max-width: 520px;
}

.hero-buttons { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-stats { display: flex; gap: 28px; margin-top: 12px; }
.stat { text-align: left; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}
.stat-label {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.hero-image-wrap { position: relative; display: flex; align-items: center; justify-content: center; }

.hero-image-box {
  width: 320px;
  height: 320px;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: inset 9px 9px 18px var(--shadow-d), inset -9px -9px 18px var(--shadow-l);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}
.hero-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/* PCB-style registration marks — the signature detail */
.corner-mark {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent);
  opacity: 0.55;
}
.corner-tl { top: -10px; left: -10px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.corner-br { bottom: -10px; right: -10px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }

.float-dot { position: absolute; border-radius: 50%; box-shadow: 5px 5px 10px var(--shadow-d), -5px -5px 10px var(--shadow-l); }
.dot-1 {
  width: 60px; height: 60px; top: 18px; right: -6px;
  background: var(--accent-soft);
  animation: float 6s ease-in-out infinite;
}
.dot-2 {
  width: 44px; height: 44px; bottom: 8px; left: -14px;
  background: var(--signal-soft);
  animation: float-delayed 8s ease-in-out 2s infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-delayed { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===========================================================
   Reveal-on-scroll
   =========================================================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ===========================================================
   Skills
   =========================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.skill-card { display: flex; flex-direction: column; gap: 20px; }

.skill-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); }

.skill-list { display: flex; flex-direction: column; gap: 9px; }
.skill-list li {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.skill-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
  margin-top: 8px;
}

/* ===========================================================
   Experience
   =========================================================== */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.exp-card { display: flex; flex-direction: column; gap: 24px; }

.exp-header { display: flex; align-items: center; gap: 16px; }

.exp-badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exp-badge.accent { color: var(--accent); background: var(--accent-soft); }
.exp-badge.teal { color: var(--signal); background: var(--signal-soft); }

.exp-heading { font-size: 1.375rem; font-weight: 700; color: var(--ink); }

.exp-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0 16px 20px;
  border-left: 2px solid rgba(82, 79, 224, 0.15);
}
.exp-role { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }

/* ===========================================================
   Projects
   =========================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.project-card { display: flex; flex-direction: column; gap: 14px; cursor: pointer; }
.project-card:hover .project-name { color: var(--accent); }

.project-name { font-size: 1.0625rem; font-weight: 700; color: var(--ink); transition: color 0.25s ease; }

.project-meta { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--ink-faint); }
.stars { display: flex; align-items: center; gap: 4px; color: #d9a441; }

.project-card-last {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  box-shadow: none;
  border: 2px dashed rgba(82, 79, 224, 0.25);
  background: transparent;
}
.project-card-last:hover { box-shadow: none; border-color: var(--accent); }
.arrow-icon { color: var(--accent); transition: transform 0.25s ease; }
.project-card-last:hover .arrow-icon { transform: translate(2px, -2px); }

.project-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* ===========================================================
   Contact
   =========================================================== */
.contact-card { display: flex; flex-direction: column; gap: 14px; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 7px 7px 14px var(--shadow-d), -7px -7px 14px var(--shadow-l);
  color: var(--ink-muted);
  transition: all 0.25s ease;
}
.contact-item:hover {
  color: var(--accent);
  box-shadow: 10px 10px 18px var(--shadow-d), -10px -10px 18px var(--shadow-l);
  transform: translateY(-2px);
}
.contact-item:active {
  transform: translateY(1px);
  box-shadow: inset 3px 3px 6px var(--shadow-d), inset -3px -3px 6px var(--shadow-l);
}

.contact-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--bg);
  box-shadow: inset 8px 8px 16px var(--shadow-d), inset -8px -8px 16px var(--shadow-l);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-info { display: flex; flex-direction: column; gap: 2px; }
.contact-label { font-size: 0.8125rem; font-weight: 600; color: var(--ink); font-family: var(--font-display); }
.contact-detail { font-size: 0.75rem; font-family: var(--font-mono); color: var(--ink-faint); }

/* ===========================================================
   Footer
   =========================================================== */
.footer { padding: 40px 24px 32px; text-align: center; }
.footer p:first-child { margin-bottom: 6px; }
.footer .text-xs { font-family: var(--font-mono); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { gap: 32px; }
  .hero-image-box { width: 280px; height: 280px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  #menu-toggle { display: flex; }

  .section { padding: 72px 20px; }

  .hero { min-height: auto; padding: 116px 20px 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero-content { align-items: center; gap: 24px; }
  .eyebrow { align-self: center; }
  .hero-subtitle { max-width: 100%; font-size: 1rem; }
  .hero-buttons { justify-content: center; width: 100%; }
  .hero-buttons a { flex: 1 1 160px; justify-content: center; }
  .hero-stats { justify-content: center; flex-wrap: wrap; gap: 22px; }
  .stat { text-align: center; }

  .hero-image-box { width: 240px; height: 240px; margin: 0 auto; order: -1; }

  .skills-grid, .exp-grid, .projects-grid { grid-template-columns: 1fr; }

  .card { padding: 26px; }
  .exp-heading { font-size: 1.25rem; }
  .contact-item { padding: 14px 18px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 56px 16px; }

  .hero { padding-top: 100px; }
  .hero-content { gap: 20px; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons a { flex: 1 1 auto; width: 100%; }

  .hero-stats { gap: 16px; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: 0.6875rem; }

  .hero-image-box { width: 208px; height: 208px; border-radius: 22px; }

  .card { padding: 22px; border-radius: 22px; }
  .contact-item { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .contact-icon { width: 40px; height: 40px; }

  .logo { height: 38px; padding: 0 14px; }
  #menu-toggle { width: 38px; height: 38px; }
}

@media (max-width: 360px) {
  .nav-container { padding: 12px 16px; }
  .hero-image-box { width: 176px; height: 176px; }
  .btn-neu, .btn-accent { padding: 11px 20px; font-size: 0.8125rem; }
}

@media (min-width: 1440px) {
  .container { max-width: 1280px; }
  .hero-image-box { width: 360px; height: 360px; }
}

/* ===========================================================
   Auto-update flash
   =========================================================== */
@keyframes update-flash {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}
.flash-update { animation: update-flash 0.5s ease-out; }

/* ===========================================================
   Reduced motion
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
