/* ========================================
   BHARGAV NATH · PORTFOLIO
   Space Grotesk + Inter — Deep Space palette
   ======================================== */

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

:root {
  --bg:          #0a0a0f;
  --bg-card:     #111118;
  --bg-dark:     #07070c;
  --violet:      #7c3aed;
  --violet-lt:   #9d65ff;
  --lavender:    #c4b5fd;
  --off-white:   #f0eeff;
  --muted:       #6b6b8a;
  --border:      #1e1e30;
  --font-display:'Space Grotesk', sans-serif;
  --font-body:   'Inter', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--off-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---- Particles Canvas ---- */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--violet); border-radius: 4px; }

/* ---- Utility ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; position: relative; z-index: 1; }

/* ==============================
   NAV
   ============================== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(14px);
  border-color: var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.3rem;
  color: var(--off-white); text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-logo .dot { color: var(--violet); }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--off-white); }
.nav-cta {
  font-size: 0.8rem; font-weight: 600;
  color: var(--lavender); text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.4rem 1rem; border-radius: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.nav-cta:hover { border-color: var(--violet); background: rgba(124,58,237,0.1); }

/* ==============================
   HERO
   ============================== */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8rem 2rem 4rem;
  position: relative; z-index: 1;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--lavender);
  border: 1px solid rgba(196,181,253,0.25);
  padding: 0.3rem 1rem; border-radius: 99px;
  margin-bottom: 2rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.name-line { display: block; }
.name-line.accent { color: var(--violet-lt); }

/* Terminal */
.hero-terminal {
  display: inline-block;
  background: #0d0d15;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  margin-bottom: 2rem;
  max-width: 520px; width: 100%;
  box-shadow: 0 0 40px rgba(124,58,237,0.12);
}
.terminal-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.65rem 1rem;
  background: #141420;
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green  { background: #28c840; }
.t-file { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.terminal-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 1rem 1.25rem;
  line-height: 1.8;
  color: #c0c0d8;
}
.t-keyword { color: #c792ea; }
.t-var     { color: #82aaff; }
.t-op      { color: #89ddff; }
.t-bracket { color: #ffcb6b; }
.t-str     { color: #c3e88d; }
.cursor {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--violet-lt);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-sub {
  max-width: 520px;
  color: var(--muted); font-size: 1.05rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 3rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--violet); color: #fff;
  text-decoration: none; padding: 0.75rem 2rem;
  border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(124,58,237,0.35);
}
.btn-primary:hover { background: var(--violet-lt); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.45); }
.btn-ghost {
  border: 1px solid var(--border); color: var(--off-white);
  text-decoration: none; padding: 0.75rem 2rem;
  border-radius: 8px; font-weight: 500; font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.2s;
}
.btn-ghost:hover { border-color: var(--violet); transform: translateY(-2px); }

.hero-stats { display: flex; align-items: center; gap: 2.5rem; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--lavender); line-height: 1; }
.stat-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; margin-top: 0.25rem; }
.stat-div { width: 1px; height: 40px; background: var(--border); }

.scroll-hint {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, var(--violet), transparent); animation: scrollpulse 1.8s ease-in-out infinite; }
@keyframes scrollpulse { 0%,100%{opacity:0.3;transform:scaleY(0.8)} 50%{opacity:1;transform:scaleY(1)} }

/* ==============================
   SECTIONS
   ============================== */
.section { padding: 7rem 0; position: relative; z-index: 1; }
.section-dark { background: var(--bg-dark); }
.section-eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--violet-lt);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--off-white);
  margin-bottom: 3rem;
}

/* ==============================
   ABOUT
   ============================== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center;
}
.about-text p { color: var(--muted); margin-bottom: 1.25rem; font-size: 1.025rem; }
.about-langs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.lang-tag {
  font-size: 0.78rem; font-weight: 500;
  border: 1px solid var(--border);
  color: var(--lavender);
  padding: 0.3rem 0.85rem; border-radius: 99px;
}

/* Orbit */
.orbit-ring {
  position: relative;
  width: 280px; height: 280px;
  margin: 0 auto;
}
.orbit-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 70px; height: 70px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.orbit-item {
  position: absolute;
  top: 50%; left: 50%;
  width: 52px; height: 52px;
  margin: -26px;
  transform: rotate(var(--angle)) translateX(110px) rotate(calc(-1 * var(--angle)));
  animation: orbit-spin 18s linear infinite;
}
.orbit-item span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--lavender);
  transition: border-color 0.2s;
}
.orbit-item:hover span { border-color: var(--violet); }
/* orbit track circle */
.orbit-ring::before {
  content:'';
  position: absolute; top: 50%; left: 50%;
  width: 220px; height: 220px;
  margin: -110px;
  border: 1px dashed rgba(124,58,237,0.2);
  border-radius: 50%;
}
@keyframes orbit-spin { from{transform:rotate(var(--angle)) translateX(110px) rotate(calc(-1*var(--angle)))} to{transform:rotate(calc(var(--angle) + 360deg)) translateX(110px) rotate(calc(-1*(var(--angle) + 360deg)))} }

/* ==============================
   SKILLS
   ============================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.skill-card::before {
  content:'';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.skill-card:hover { border-color: rgba(124,58,237,0.45); transform: translateY(-3px); box-shadow: 0 12px 35px rgba(124,58,237,0.1); }
.skill-card:hover::before { opacity: 1; }
.skill-card-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }
.skill-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--off-white); margin-bottom: 0.9rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tags span {
  font-size: 0.72rem; font-weight: 500;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--lavender);
  padding: 0.25rem 0.6rem; border-radius: 5px;
}

/* ==============================
   TIMELINE / EXPERIENCE
   ============================== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content:'';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 3.5rem;
  animation-delay: var(--delay, 0s);
}
.timeline-marker {
  position: absolute; left: -2rem; top: 0.25rem;
  width: 12px; height: 12px;
  background: var(--violet);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(124,58,237,0.6);
  transform: translateX(-5.5px);
}
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.25s;
}
.timeline-content:hover { border-color: rgba(124,58,237,0.35); }
.tl-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.tl-date { font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono); }
.tl-badge {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--violet-lt);
  padding: 0.15rem 0.55rem; border-radius: 4px;
}
.tl-badge-alt { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); color: #4ade80; }
.tl-role { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--off-white); }
.tl-company { font-size: 0.85rem; color: var(--lavender); display: block; margin: 0.2rem 0 0.75rem; }
.tl-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.9rem; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tl-tags span {
  font-size: 0.7rem; font-weight: 500;
  background: rgba(10,10,15,0.8);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.55rem; border-radius: 4px;
}

/* ==============================
   PROJECTS
   ============================== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1.5rem; }
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  position: relative; overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover { border-color: rgba(124,58,237,0.45); transform: translateY(-4px); }
.project-glow {
  position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.project-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.project-icon { font-size: 2rem; }
.p-link {
  font-size: 0.75rem; font-weight: 600;
  color: var(--lavender); text-decoration: none;
  border: 1px solid rgba(196,181,253,0.2);
  padding: 0.3rem 0.75rem; border-radius: 6px;
  transition: border-color 0.2s;
}
.p-link:hover { border-color: var(--lavender); }
.project-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--off-white); }
.project-sub { font-size: 0.8rem; color: var(--violet-lt); margin-bottom: 0.75rem; font-weight: 500; }
.project-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.65; }
.project-meta { margin-bottom: 0.75rem; }
.project-date { font-size: 0.72rem; color: var(--muted); font-family: var(--font-mono); }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tags span {
  font-size: 0.72rem; font-weight: 500;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.18);
  color: var(--lavender);
  padding: 0.25rem 0.6rem; border-radius: 5px;
}

/* ==============================
   EDUCATION
   ============================== */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.25s, transform 0.25s;
}
.edu-card:hover { border-color: rgba(124,58,237,0.4); transform: translateY(-3px); }
.edu-degree { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--off-white); margin-bottom: 0.35rem; }
.edu-school { color: var(--violet-lt); font-weight: 500; font-size: 0.9rem; }
.edu-year { font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono); margin: 0.4rem 0 0.8rem; }
.edu-courses { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ==============================
   CONTACT
   ============================== */
.contact-container { text-align: center; }
.contact-sub { color: var(--muted); font-size: 1.05rem; max-width: 480px; margin: 0 auto 3rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.75rem;
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  min-width: 170px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.contact-card:hover { border-color: var(--violet); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(124,58,237,0.15); }
.contact-card-icon { font-size: 1.5rem; }
.contact-card-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.contact-card-val { font-size: 0.8rem; color: var(--lavender); font-weight: 500; }

/* ==============================
   FOOTER
   ============================== */
footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  position: relative; z-index: 1;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: var(--muted);
  flex-wrap: wrap; gap: 0.5rem;
}

/* ==============================
   ANIMATIONS
   ============================== */
.reveal-up, .reveal-left, .reveal-right {
  opacity: 0; transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--delay, 0s);
}
.reveal-up    { transform: translateY(30px); }
.reveal-left  { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-visual { order: -1; }
  .projects-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
  .nav-links { display: none; }
  .orbit-ring { width: 220px; height: 220px; }
  .orbit-item { transform: rotate(var(--angle)) translateX(85px) rotate(calc(-1*var(--angle))); }
  .orbit-ring::before { width: 170px; height: 170px; margin: -85px; }
  @keyframes orbit-spin { from{transform:rotate(var(--angle)) translateX(85px) rotate(calc(-1*var(--angle)))} to{transform:rotate(calc(var(--angle) + 360deg)) translateX(85px) rotate(calc(-1*(var(--angle) + 360deg)))} }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal-up, .reveal-left, .reveal-right { opacity: 1; transform: none; }
}
