/* =========================================
   Md Shariar Hossain — Portfolio
   Modern Dark Minimal · vanilla CSS
   ========================================= */

:root {
  --bg: #0a0a0f;
  --bg-alt: #0d0d14;
  --surface: #12121a;
  --surface-hi: #161620;
  --border: #1f1f2e;
  --border-hi: #2a2a3d;
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --text-mute: #71717a;
  --primary: #6366f1;
  --primary-hi: #818cf8;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #34d399;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-text: linear-gradient(135deg, #818cf8 0%, #c084fc 60%, #22d3ee 100%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(99,102,241,.15);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --container: 1200px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(99,102,241,.07) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(139,92,246,.06) 0px, transparent 50%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a {
  color: var(--primary-hi);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--cyan); }

code, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}

p { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--text-dim); }
.muted-sm { color: var(--text-mute); font-size: .85rem; }

/* =========================================
   NAV
========================================= */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 50;
  background: rgba(10,10,15,.7);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
#nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10,10,15,.85);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text);
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad);
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.nav-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-dim);
  font-size: .92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--grad);
  margin-top: 2px;
  border-radius: 2px;
}
#nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* =========================================
   BUTTONS
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 18px rgba(99,102,241,.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(99,102,241,.55);
  color: white;
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hi);
  background: var(--surface-hi);
  color: var(--text);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hi);
}
.btn-outline:hover {
  background: var(--surface);
  color: var(--text);
}

/* =========================================
   SECTION SCAFFOLD
========================================= */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 96px 0;
  position: relative;
}
.section-alt { background: var(--bg-alt); }
.section-head {
  margin-bottom: 48px;
  max-width: 720px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--primary);
  letter-spacing: .08em;
  display: block;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.section-sub {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0;
}

/* =========================================
   HERO
========================================= */
.section-hero {
  padding-top: calc(var(--nav-h) + 80px);
  padding-bottom: 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
}
.orb-1 { width: 380px; height: 380px; background: #6366f1; top: -80px; left: -80px; }
.orb-2 { width: 320px; height: 320px; background: #8b5cf6; top: 30%; right: -60px; }
.orb-3 { width: 260px; height: 260px; background: #22d3ee; bottom: -100px; left: 30%; opacity: .25; }

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(34,211,238,.08);
  border: 1px solid rgba(34,211,238,.25);
  border-radius: 100px;
  font-size: .82rem;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 24px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34,211,238,.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.hero-role {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 500;
  color: var(--text-dim);
  margin: 0 0 24px;
  letter-spacing: -.01em;
}
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-summary {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 32px;
}
.hero-summary a { color: var(--cyan); border-bottom: 1px dashed rgba(34,211,238,.35); }
.hero-summary a:hover { border-bottom-color: var(--cyan); }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
}
.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: .88rem;
}
.hero-meta-item:hover { color: var(--text); }

.hero-photo {
  display: flex;
  justify-content: center;
}
.photo-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 4px;
  background: var(--grad);
  position: relative;
  box-shadow: 0 20px 60px rgba(99,102,241,.35);
}
.photo-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6366f1, #8b5cf6, #22d3ee, #6366f1);
  z-index: -1;
  opacity: .3;
  filter: blur(20px);
}
.photo-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

/* =========================================
   ABOUT
========================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  font-size: 1.02rem;
  color: var(--text-dim);
}
.about-text p strong { color: var(--text); }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.about-side {
  display: grid;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-soft { background: linear-gradient(180deg, var(--surface) 0%, rgba(18,18,26,.5) 100%); }
.card h4 {
  margin: 0 0 12px;
  font-size: .82rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bullet-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: .95rem;
}
.bullet-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* =========================================
   TIMELINE
========================================= */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--violet) 50%, transparent 100%);
}
.timeline-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 4px; top: 14px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .2s ease, transform .2s ease;
}
.timeline-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.timeline-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--cyan);
}
.timeline-loc {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--text-mute);
}
.timeline-role {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.timeline-company {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-weight: 500;
}
.timeline-card .bullet-list { margin-bottom: 16px; }

/* =========================================
   CHIPS
========================================= */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 6px;
  color: var(--primary-hi);
  font-family: 'JetBrains Mono', monospace;
  font-size: .76rem;
  font-weight: 500;
}
.chip-row-sm .chip { font-size: .72rem; padding: 3px 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 5px;
  background: var(--surface-hi);
  color: var(--text-dim);
  border: 1px solid var(--border-hi);
}
.badge-live {
  background: rgba(52,211,153,.1);
  color: var(--green);
  border-color: rgba(52,211,153,.3);
}
.badge-os {
  background: rgba(139,92,246,.12);
  color: #c084fc;
  border-color: rgba(139,92,246,.3);
}

/* =========================================
   FEATURED PROJECTS
========================================= */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.featured-grid > .feature-card:nth-child(1),
.featured-grid > .feature-card:nth-child(3) {
  /* alternating layout ok */
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-lg);
}
.feature-visual {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.feature-visual img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.3));
}
.feature-visual-svg svg {
  width: 80%;
  max-width: 320px;
  height: auto;
}
.feature-body {
  padding: 24px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.feature-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.feature-body h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.feature-body p {
  margin: 0;
  color: var(--text-dim);
  font-size: .94rem;
}
.feature-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: auto;
}
.link-arrow {
  color: var(--cyan);
  font-size: .9rem;
  font-weight: 500;
  transition: transform .15s ease;
  display: inline-flex;
}
.link-arrow:hover { transform: translateX(2px); }

.codeblock {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
}
.code-prompt { color: var(--green); font-weight: 700; }

/* =========================================
   MINI PROJECTS
========================================= */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  color: var(--text);
}
.mini-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: var(--surface-hi);
  color: var(--text);
}
.mini-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-hi);
  margin-bottom: 4px;
}
.mini-card h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.mini-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: .88rem;
  flex: 1;
}
.mini-card code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .8em;
}

/* =========================================
   PUBLICATIONS
========================================= */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.pub-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  align-items: start;
  transition: border-color .2s ease;
}
.pub-item:hover { border-color: var(--border-hi); }
.pub-year {
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan);
  font-size: .9rem;
  padding-top: 4px;
}
.pub-body h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.pub-body p { margin: 0 0 8px; font-size: .9rem; }

/* =========================================
   SKILLS
========================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.skill-group h4 {
  margin: 0 0 14px;
  font-size: .82rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

/* =========================================
   EDUCATION
========================================= */
.edu-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 18px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.edu-meta { margin-bottom: 8px; }
.edu-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.edu-card p { margin: 0 0 6px; font-size: .92rem; color: var(--text-dim); }

/* =========================================
   CONTACT
========================================= */
.contact-wrap {
  text-align: center;
  max-width: 720px;
}
.contact-wrap .section-head { margin-left: auto; margin-right: auto; }
.contact-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.social-row {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.social-row a {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: transform .15s ease, color .15s ease, border-color .15s ease;
}
.social-row a:hover {
  transform: translateY(-2px);
  color: var(--primary-hi);
  border-color: var(--primary);
}
#copy-email.copied {
  background: var(--green);
  box-shadow: 0 4px 18px rgba(52,211,153,.4);
}

/* =========================================
   FOOTER
========================================= */
.footer {
  margin-top: 64px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================
   REVEAL ANIMATIONS
========================================= */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { order: -1; }
  .photo-ring { width: 200px; height: 200px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .featured-grid { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  #nav-toggle { display: inline-flex; }
  body.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 18px;
    gap: 4px;
    margin-left: 0;
  }
  body.nav-open .nav-links a { padding: 10px 14px; }
  .nav-inner { gap: 14px; }
  .section { padding: 64px 0; }
  .section-hero { padding-top: calc(var(--nav-h) + 48px); min-height: auto; }
  .mini-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; gap: 14px; }
  .feature-visual { height: 160px; }
  .timeline-card { padding: 20px; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 2.2rem; }
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }
}

/* =========================================
   SELECTION
========================================= */
::selection {
  background: rgba(99,102,241,.4);
  color: white;
}

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