/* ============================================================
   style.css — Bhargav.tech Portfolio
   ============================================================ */

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

:root {
  --bg: #080b12;
  --surface: #0e1420;
  --surface2: #141c2e;
  --border: rgba(100,180,255,0.12);
  --accent: #3b82f6;
  --accent2: #06b6d4;
  --accent-glow: rgba(59,130,246,0.15);
  --text: #e2e8f0;
  --muted: #64748b;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
}

html { scroll-behavior: smooth; }

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

/* ── GRID BG ── */
.grid-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
}

/* ── NOISE ── */
.noise {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* ── SCAN LINE ── */
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100vh); } }
.scanline {
  position: fixed; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.04), transparent);
  animation: scan 8s linear infinite;
  pointer-events: none; z-index: 200;
}

/* ── PROGRESS BAR ── */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 300; width: 0; transition: width .08s;
}

/* ── CURSOR ── */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; border-radius: 50%;
  transform: translate(-50%, -50%); z-index: 9999;
}
.cursor-dot { width: 5px; height: 5px; background: #fff; opacity: .9; }
.cursor-ring {
  width: 30px; height: 30px;
  border: 1px solid rgba(59,130,246,.55); background: transparent;
  transition: width .2s ease, height .2s ease, border-color .2s ease;
}
body.cursor-hover .cursor-ring { width: 44px; height: 44px; border-color: rgba(6,182,212,.6); }
body.cursor-hover .cursor-dot  { opacity: .35; }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 4rem;
  background: rgba(8,11,18,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav.scrolled { padding: .75rem 4rem; }
.nav-logo { font-family: var(--mono); font-size: .85rem; color: var(--accent); letter-spacing: .05em; }
.nav-logo span { color: var(--accent2); }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  text-decoration: none; letter-spacing: .08em; text-transform: uppercase;
  transition: color .2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width .25s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

/* ── HAMBURGER ── */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; }
.hamburger span { display: block; width: 22px; height: 1.5px; background: var(--muted); transition: transform .3s, opacity .3s; }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.mobile-menu {
  display: none; position: fixed; inset: 0;
  background: rgba(8,11,18,.97); z-index: 99;
  flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-family: var(--mono); font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .1em; text-transform: uppercase; transition: color .2s; }
.mobile-menu a:hover { color: var(--accent); }

/* ── HERO ── */
#hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  padding: 8rem 4rem 4rem; z-index: 1; overflow: hidden;
}

.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.orb1 { width: 500px; height: 500px; background: rgba(59,130,246,0.12); top: -100px; right: -100px; }
.orb2 { width: 350px; height: 350px; background: rgba(6,182,212,0.08);  bottom: 50px; left: -80px; }

/* avail badge */
.avail-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .65rem; color: #4ade80;
  background: rgba(74,222,128,.07); border: 1px solid rgba(74,222,128,.18);
  padding: .35rem .8rem; margin-bottom: 1.5rem;
  letter-spacing: .1em; text-transform: uppercase; width: fit-content;
  opacity: 0; animation: fadeUp .6s .05s ease forwards;
}
.status-dot { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; flex-shrink: 0; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.4); } 50% { box-shadow: 0 0 0 5px rgba(74,222,128,0); } }
.status-dot { animation: pulse 2s ease-in-out infinite; }

.hero-tag {
  font-family: var(--mono); font-size: .75rem; color: var(--accent);
  letter-spacing: .15em; text-transform: uppercase;
  margin-bottom: 1.5rem; display: flex; align-items: center; gap: .75rem;
  opacity: 0; animation: fadeUp .6s .15s ease forwards;
}
.hero-tag::before { content: ''; display: inline-block; width: 24px; height: 1px; background: var(--accent); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.blink { display: inline-block; width: 7px; height: 13px; background: var(--accent2); margin-left: 3px; animation: blink 1s step-end infinite; vertical-align: text-bottom; }

h1.hero-name {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -0.025em;
  margin-bottom: 0.6rem; max-width: 900px;
  transform: scaleY(1.08); transform-origin: top;
  opacity: 0; animation: fadeUp .7s .28s ease forwards;
}
.name-line1 { display: block; white-space: nowrap; }
.line2 { color: transparent; -webkit-text-stroke: 1px rgba(59,130,246,0.35); opacity: 0.9; margin-top: 0.18rem; }

.hero-subtitle {
  font-family: var(--mono); font-size: clamp(.78rem,1.4vw,.92rem);
  color: var(--muted); margin: 1.5rem 0 2.5rem; max-width: 540px;
  line-height: 1.9; opacity: 0; animation: fadeUp .7s .42s ease forwards;
}
.hero-subtitle em { font-style: normal; color: var(--accent2); }

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; opacity: 0; animation: fadeUp .7s .56s ease forwards; }

/* ── HERO STATS ── */
.hero-stats {
  position: absolute; right: 4rem; bottom: 4rem;
  display: flex; gap: 2.5rem;
  opacity: 0; animation: fadeUp .7s .72s ease forwards;
}
.stat-item { text-align: right; }
.stat-num { font-family: var(--sans); font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-family: var(--mono); font-size: .65rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: .25rem; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .85rem 1.8rem; border: none; cursor: pointer; text-decoration: none;
  transition: opacity .2s, transform .2s; position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.12) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .5s;
}
.btn-primary:hover { opacity: .85; transform: translateY(-1px); }
.btn-primary:hover::after { transform: translateX(100%); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: var(--text);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .85rem 1.8rem; border: 1px solid var(--border); cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-download {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: var(--accent2);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .85rem 1.8rem; border: 1px solid rgba(6,182,212,.3); cursor: pointer; text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}
.btn-download:hover { border-color: var(--accent2); background: rgba(6,182,212,.08); transform: translateY(-1px); }
.btn-download svg { transition: transform .3s; }
.btn-download:hover svg { transform: translateY(2px); }

/* ── DIVIDER ── */
hr.divider { border: none; border-top: 1px solid var(--border); position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

/* ── SECTIONS ── */
section { position: relative; z-index: 1; padding: 5rem 4rem; max-width: 1200px; margin: 0 auto; }
.section-label {
  font-family: var(--mono); font-size: .7rem; color: var(--accent);
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: .75rem;
  display: flex; align-items: center; gap: .75rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); max-width: 200px; }
h2.section-title { font-family: var(--sans); font-size: clamp(2rem,4vw,3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 3rem; line-height: 1.1; }

/* ── SKILLS ── */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.skill-cell { background: var(--surface); padding: 1.5rem; transition: background .2s; position: relative; overflow: hidden; }
.skill-cell::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.skill-cell:hover { background: var(--surface2); }
.skill-cell:hover::before { transform: scaleX(1); }
.skill-category { font-family: var(--mono); font-size: .65rem; color: var(--accent2); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.skill-tag { font-family: var(--mono); font-size: .72rem; color: var(--muted); background: rgba(100,180,255,0.06); border: 1px solid var(--border); padding: .25rem .6rem; letter-spacing: .03em; transition: color .2s, border-color .2s; }
.skill-cell:hover .skill-tag { color: var(--text); border-color: rgba(100,180,255,0.25); }

/* ── PROJECTS ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.project-card { background: var(--surface); border: 1px solid var(--border); padding: 2rem; position: relative; overflow: hidden; transition: border-color .3s, transform .3s; cursor: default; }
.project-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.project-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-3px); }
.project-card:hover::before { transform: scaleX(1); }
.project-num { font-family: var(--mono); font-size: .65rem; color: var(--accent); letter-spacing: .1em; margin-bottom: 1rem; opacity: .6; }
.project-title { font-family: var(--sans); font-size: 1.15rem; font-weight: 700; margin-bottom: .75rem; line-height: 1.3; }
.project-highlight { font-family: var(--mono); font-size: .72rem; color: var(--accent2); margin-bottom: 1.25rem; }
.project-desc { font-size: .85rem; color: var(--muted); line-height: 1.7; margin-bottom: 1.25rem; }
.tech-stack { display: flex; flex-wrap: wrap; gap: .4rem; }
.tech-pill { font-family: var(--mono); font-size: .65rem; color: var(--accent); background: var(--accent-glow); border: 1px solid rgba(59,130,246,.2); padding: .2rem .55rem; letter-spacing: .04em; }

/* project action buttons */
.project-actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.project-btn-demo {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent2); background: transparent;
  border: 1px solid rgba(6,182,212,.4); padding: .5rem 1rem; text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
}
.project-btn-demo:hover { border-color: var(--accent2); background: rgba(6,182,212,.08); transform: translateY(-1px); }
.project-btn-github {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border); padding: .5rem 1rem; text-decoration: none;
  transition: color .2s, border-color .2s, transform .2s;
}
.project-btn-github:hover { color: var(--text); border-color: rgba(100,180,255,.25); transform: translateY(-1px); }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(to bottom, var(--accent), transparent); }
.timeline-item { position: relative; margin-bottom: 3rem; padding-left: 1.5rem; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: .35rem; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.timeline-period { font-family: var(--mono); font-size: .68rem; color: var(--accent2); letter-spacing: .08em; margin-bottom: .4rem; }
.timeline-role { font-family: var(--sans); font-size: 1.1rem; font-weight: 700; margin-bottom: .2rem; }
.timeline-org { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-bottom: .75rem; }
.timeline-bullets { list-style: none; padding: 0; }
.timeline-bullets li { font-size: .85rem; color: var(--muted); padding: .25rem 0 .25rem 1rem; position: relative; line-height: 1.6; }
.timeline-bullets li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

/* ── EDUCATION ── */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.edu-card { background: var(--surface); border: 1px solid var(--border); padding: 1.75rem; position: relative; overflow: hidden; transition: border-color .3s; }
.edu-card:hover { border-color: rgba(100,180,255,.25); }
.edu-card::after { content: attr(data-gpa); position: absolute; right: 1.5rem; top: 1.5rem; font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); opacity: .15; }
.edu-degree { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin-bottom: .3rem; }
.edu-school  { font-family: var(--mono); font-size: .75rem; color: var(--accent2); letter-spacing: .05em; margin-bottom: .5rem; }
.edu-period  { font-family: var(--mono); font-size: .68rem; color: var(--muted); margin-bottom: .75rem; }
.edu-gpa     { font-family: var(--mono); font-size: .75rem; color: var(--accent); }

/* ── CONTACT ── */
#contact-section { text-align: center; padding: 6rem 4rem; position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.contact-tagline { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .1em; margin-bottom: 2rem; line-height: 1.8; max-width: 480px; margin-left: auto; margin-right: auto; }
.contact-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.contact-link { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-decoration: none; letter-spacing: .08em; display: flex; align-items: center; gap: .4rem; border: 1px solid var(--border); padding: .6rem 1.2rem; transition: color .2s, border-color .2s; }
.contact-link:hover { color: var(--accent); border-color: var(--accent); }

/* ── FOOTER ── */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 1.5rem 4rem; display: flex; justify-content: space-between; align-items: center; }
footer p { font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .06em; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { opacity: 0; animation: fadeUp .7s ease forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .25s; }
.delay-3 { animation-delay: .4s; }
.delay-4 { animation-delay: .55s; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: .07s; }
.stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: .14s; }
.stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: .21s; }
.stagger.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: .28s; }
.stagger.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: .35s; }
.stagger.visible > *:nth-child(7) { opacity: 1; transform: none; transition-delay: .42s; }
.stagger.visible > *:nth-child(8) { opacity: 1; transform: none; transition-delay: .49s; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 768px) {
  /* NAV */
  nav { padding: 0.9rem 1.25rem; }

  /* HERO — clean single column */
  #hero {
    min-height: 100vh;
    padding: 7rem 1.25rem 3rem !important;
    align-items: flex-start;
    overflow-x: hidden;
  }
  #hero > div { max-width: 100%; width: 100%; }

  /* hide stats completely on mobile — they overflow */
  .hero-stats { display: none; }

  /* badge — let it wrap instead of overflow */
  .avail-badge {
    font-size: .58rem;
    white-space: normal;
    max-width: 100%;
    line-height: 1.5;
  }

  /* hero tag */
  .hero-tag { font-size: .65rem; margin-bottom: 1.25rem; }

  /* name — smaller, no transform stretch */
  h1.hero-name {
    font-size: clamp(2.4rem, 11vw, 3.2rem);
    line-height: 1.05;
    transform: none;
    max-width: 100%;
  }
  .name-line1 { white-space: normal; }

  /* subtitle */
  .hero-subtitle { max-width: 100%; font-size: .82rem; margin: 1.25rem 0 2rem; }

  /* buttons stack cleanly */
  .hero-ctas { flex-direction: column; width: 100%; gap: .75rem; }
  .hero-ctas a { width: 100%; justify-content: center; }

  /* sections */
  section { padding: 3.5rem 1.25rem; }

  /* skills */
  .skills-grid { grid-template-columns: 1fr 1fr; }

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

  /* contact */
  #contact-section { padding: 3.5rem 1.25rem; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-link { justify-content: center; }

  /* footer */
  footer { flex-direction: column; gap: .5rem; text-align: center; padding: 1.25rem 1.25rem; }
}
@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  h1.hero-name { font-size: 2.4rem; }
}