/* ═══════════════════════════════════════════
   PORTFOLIO – Rakesh Kumar Singh
   style.css
═══════════════════════════════════════════ */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #060a12;
  --bg-dark: #030610;
  --surface: #0d1525;
  --surface-2: #111c30;
  --border: rgba(99,160,255,0.12);
  --border-hover: rgba(99,160,255,0.35);

  --primary: #4f8eff;
  --primary-glow: rgba(79,142,255,0.35);
  --secondary: #7c3aed;
  --accent: #06d6a0;
  --warn: #f59e0b;

  --text: #e2e8f4;
  --text-muted: #7a8ba8;
  --text-dim: #3d5070;

  --grad-1: linear-gradient(135deg, #4f8eff 0%, #7c3aed 100%);
  --grad-2: linear-gradient(135deg, #06d6a0 0%, #4f8eff 100%);

  --radius: 16px;
  --radius-sm: 8px;
  --nav-h: 72px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
svg { fill: currentColor; }
img { max-width: 100%; }
strong { color: #fff; font-weight: 600; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ── Custom Cursor ── */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .15s, height .15s, background .15s;
}
.cursor-follower {
  position: fixed; top: 0; left: 0; z-index: 9998;
  width: 36px; height: 36px;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width .3s, height .3s, border-color .3s;
  opacity: 0.5;
}
body:has(a:hover) .cursor { width: 14px; height: 14px; background: var(--accent); }
body:has(a:hover) .cursor-follower { width: 52px; height: 52px; border-color: var(--accent); opacity: 0.3; }

/* ── Utility ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.gradient-text { background: var(--grad-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.section { padding: 110px 0; position: relative; }
.section-dark { background: var(--bg-dark); }
.section-label {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--primary); font-family: 'Fira Code', monospace;
  margin-bottom: 14px; opacity: .85;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  color: #fff; margin-bottom: 56px; line-height: 1.1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px;
  font-weight: 600; font-size: .95rem;
  transition: var(--transition); cursor: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--grad-1); color: #fff;
  box-shadow: 0 0 28px rgba(79,142,255,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(79,142,255,0.5); }
.btn-outline {
  border-color: var(--primary); color: var(--primary);
}
.btn-outline:hover { background: rgba(79,142,255,.1); transform: translateY(-2px); }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-nav {
  padding: 10px 22px; border-radius: 50px;
  background: var(--grad-1); color: #fff !important; font-weight: 600;
  transition: var(--transition);
}
.btn-nav:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,142,255,0.45); }

/* ── NAV ── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  transition: background .4s, backdrop-filter .4s, box-shadow .4s;
}
#navbar.scrolled {
  background: rgba(6,10,18,.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 1.6rem; font-weight: 900; color: #fff; letter-spacing: -.03em;
}
.logo span { color: var(--primary); }
.nav-links {
  display: flex; align-items: center; gap: 36px;
}
.nav-links a {
  font-size: .9rem; font-weight: 500; color: var(--text-muted);
  transition: color .25s; position: relative;
}
.nav-links a:not(.btn-nav)::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 2px; background: var(--primary); border-radius: 1px;
  transform: scaleX(0); transition: transform .3s;
}
.nav-links a:not(.btn-nav):hover { color: #fff; }
.nav-links a:not(.btn-nav):hover::after { transform: scaleX(1); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: none; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .3s;
}

/* ── HERO ── */
#hero {
  min-height: 100vh; display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding-top: var(--nav-h);
}
#bgCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0;
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  padding-top: 40px;
}
.hero-pre {
  font-family: 'Fira Code', monospace;
  color: var(--accent); font-size: .95rem; margin-bottom: 16px;
  opacity: 0; animation: fadeUp .7s .2s forwards;
}
.hero-name {
  font-size: clamp(3rem, 7vw, 6rem); font-weight: 900;
  line-height: 1.0; color: #fff; margin-bottom: 22px;
  opacity: 0; animation: fadeUp .7s .4s forwards;
}
.hero-typewriter {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600;
  color: var(--text-muted); margin-bottom: 22px; min-height: 2em;
  opacity: 0; animation: fadeUp .7s .6s forwards;
}
.caret {
  display: inline-block; color: var(--primary);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-sub {
  color: var(--text-muted); font-size: 1.05rem; line-height: 1.7;
  max-width: 560px; margin-bottom: 40px;
  opacity: 0; animation: fadeUp .7s .8s forwards;
}
.hero-cta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px;
  opacity: 0; animation: fadeUp .7s 1s forwards;
}
.hero-socials {
  display: flex; gap: 16px;
  opacity: 0; animation: fadeUp .7s 1.2s forwards;
}
.hero-socials a {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition);
}
.hero-socials a svg { width: 18px; height: 18px; }
.hero-socials a:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(79,142,255,.1); transform: translateY(-3px);
}
.hero-scroll {
  position: absolute; bottom: 40px; right: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  z-index: 1;
  opacity: 0; animation: fadeUp .7s 1.4s forwards;
}
.scroll-line {
  width: 1px; height: 64px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{transform:scaleY(1);opacity:.5} 50%{transform:scaleY(1.1);opacity:1} }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ABOUT ── */
.about-grid {
  display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: start;
}
.about-text p {
  color: var(--text-muted); margin-bottom: 18px; font-size: 1.04rem;
}
.about-stats {
  display: flex; gap: 40px; margin-top: 40px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: 2.6rem; font-weight: 900; line-height: 1;
  background: var(--grad-1); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: .78rem; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; }
.about-card-wrap { position: relative; }
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px; position: relative; overflow: hidden;
}
.card-glow {
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: var(--primary-glow); border-radius: 50%;
  filter: blur(60px); pointer-events: none;
}
.about-avatar {
  width: 100px; height: 100px; margin: 0 auto 28px;
  position: relative; display: flex; align-items: center; justify-content: center;
}
.avatar-text {
  position: relative; z-index: 1;
  font-size: 1.5rem; font-weight: 800;
  background: var(--grad-1); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.avatar-ring {
  position: absolute; border-radius: 50%; border: 1px solid;
  animation: rotate 8s linear infinite;
}
.ring1 { inset: 0; border-color: rgba(79,142,255,.35); }
.ring2 { inset: -12px; border-color: rgba(124,58,237,.2); animation-duration: 12s; animation-direction: reverse; }
@keyframes rotate { to { transform: rotate(360deg); } }
.about-meta { display: flex; flex-direction: column; gap: 14px; }
.meta-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.meta-key { font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; flex-shrink: 0; }
.meta-val { font-size: .9rem; color: var(--text); font-weight: 500; text-align: right; }
.meta-val.available { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(6,214,160,.4)} 50%{box-shadow:0 0 0 6px rgba(6,214,160,0)} }

/* ── SKILLS ── */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  opacity: 0; transform: translateY(20px);
}
.skill-category.visible { opacity: 1; transform: translateY(0); }
.skill-category:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0,0,0,.4);
}
.skill-cat-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.skill-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px; background: rgba(79,142,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.skill-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.skill-cat-header h3 { font-size: 1rem; font-weight: 700; color: #fff; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 12px; border-radius: 50px;
  font-size: .76rem; font-weight: 600;
  letter-spacing: .03em;
}
.tag-primary { background: rgba(79,142,255,.15); color: #82b4ff; border: 1px solid rgba(79,142,255,.25); }
.tag-secondary { background: rgba(124,58,237,.15); color: #b49dff; border: 1px solid rgba(124,58,237,.25); }
.tag-tertiary { background: rgba(6,214,160,.1); color: #4dffd0; border: 1px solid rgba(6,214,160,.2); }

/* ── EXPERIENCE / TIMELINE ── */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
  border-radius: 1px;
}
.timeline-item {
  position: relative; margin-bottom: 48px;
  opacity: 0; transform: translateX(-20px);
  transition: opacity .6s ease, transform .6s ease;
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }
.timeline-dot {
  position: absolute; left: -38px; top: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(79,142,255,.15);
  transition: var(--transition);
}
.timeline-item:hover .timeline-dot {
  background: var(--primary); box-shadow: 0 0 0 8px rgba(79,142,255,.2);
}
.timeline-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px;
  transition: var(--transition);
}
.timeline-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
  transform: translateY(-2px);
}
.tc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.tc-role { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.tc-company { color: var(--primary); font-weight: 600; font-size: .9rem; }
.tc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tc-date {
  font-size: .78rem; font-family: 'Fira Code', monospace;
  color: var(--accent); white-space: nowrap;
}
.tc-location { font-size: .78rem; color: var(--text-dim); }
.tc-bullets { padding-left: 0; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tc-bullets li {
  padding-left: 18px; position: relative;
  color: var(--text-muted); font-size: .93rem; line-height: 1.6;
}
.tc-bullets li::before {
  content: '▸'; position: absolute; left: 0;
  color: var(--primary); font-size: .8rem; top: 2px;
}
.tc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-tags span {
  padding: 4px 12px; border-radius: 50px;
  font-size: .72rem; font-weight: 600;
  background: rgba(79,142,255,.08);
  border: 1px solid rgba(79,142,255,.18);
  color: var(--text-muted);
}

/* ── PROJECTS ── */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  position: relative; overflow: hidden;
  transition: var(--transition);
  opacity: 0; transform: translateY(20px);
}
.project-card.visible { opacity: 1; transform: translateY(0); }
.project-card-glow {
  position: absolute; top: -40px; left: -40px;
  width: 180px; height: 180px;
  background: rgba(79,142,255,.08); border-radius: 50%;
  filter: blur(40px); pointer-events: none;
  transition: var(--transition);
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(0,0,0,.4);
}
.project-card:hover .project-card-glow { background: rgba(79,142,255,.16); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.project-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--grad-1); display: flex; align-items: center; justify-content: center;
}
.project-icon svg { width: 24px; height: 24px; fill: #fff; }
.project-links { display: flex; align-items: center; gap: 10px; }
.project-link-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition);
}
.project-link-btn svg { width: 15px; height: 15px; }
.project-link-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(79,142,255,.12); transform: translateY(-2px);
}
.project-year {
  font-family: 'Fira Code', monospace; font-size: .75rem;
  color: var(--text-dim);
}
.project-card h3 { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.project-card > p { color: var(--text-muted); font-size: .93rem; line-height: 1.65; margin-bottom: 22px; }
.project-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.project-stack span {
  padding: 4px 12px; border-radius: 50px;
  font-size: .73rem; font-weight: 600;
  background: rgba(124,58,237,.12); color: #b49dff;
  border: 1px solid rgba(124,58,237,.2);
}

/* ── EDUCATION ── */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  display: flex; gap: 20px; align-items: flex-start;
  transition: var(--transition);
  opacity: 0; transform: translateY(20px);
}
.edu-card.visible { opacity: 1; transform: translateY(0); }
.edu-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}
.edu-year {
  font-family: 'Fira Code', monospace; font-size: .73rem;
  color: var(--accent); flex-shrink: 0; min-width: 70px; padding-top: 4px;
}
.edu-body h3 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 6px; line-height: 1.3; }
.edu-inst { font-size: .88rem; color: var(--primary); margin-bottom: 2px; }
.edu-uni { font-size: .8rem; color: var(--text-dim); }
.edu-badge {
  margin-left: auto; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--grad-1); display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
}

/* ── CONTACT ── */
.contact-intro {
  color: var(--text-muted); font-size: 1.1rem;
  max-width: 560px; margin-bottom: 52px; line-height: 1.7;
}
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; }
.contact-cards { display: flex; flex-direction: column; gap: 16px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px 22px;
  display: flex; align-items: center; gap: 18px;
  transition: var(--transition);
}
.contact-card:hover {
  border-color: var(--border-hover);
  transform: translateX(6px);
  background: var(--surface-2);
}
.cc-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px;
  background: rgba(79,142,255,.12); display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.cc-icon svg { width: 20px; height: 20px; }
.cc-label { font-size: .74rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.cc-value { font-size: .92rem; color: var(--text); font-weight: 500; }
.contact-cta-wrap { position: sticky; top: 100px; }
.contact-cta-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px;
  position: relative; overflow: hidden; text-align: center;
}
.cta-glow {
  position: absolute; top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  background: var(--primary-glow); border-radius: 50%;
  filter: blur(60px); pointer-events: none;
}
.contact-cta-box h3 {
  font-size: 1.4rem; font-weight: 800; color: #fff;
  margin-bottom: 10px; position: relative;
}
.contact-cta-box p { color: var(--text-muted); margin-bottom: 28px; font-size: .93rem; position: relative; }
.contact-cta-box .btn { display: block; text-align: center; margin-bottom: 12px; position: relative; }

/* ── FOOTER ── */
footer {
  background: var(--bg-dark); border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
footer p { font-size: .82rem; color: var(--text-dim); }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a {
  font-size: .8rem; color: var(--text-dim); font-weight: 600;
  transition: color .25s;
}
.footer-socials a:hover { color: var(--primary); }

/* ── AOS (Intersection Observer) ── */
[data-aos] { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
[data-aos].visible { opacity: 1; transform: none; }

/* ── MOBILE ── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-card-wrap { order: -1; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-cta-wrap { position: static; }
}
@media (max-width: 700px) {
  :root { --nav-h: 60px; }
  .section { padding: 80px 0; }
  .nav-links { display: none; flex-direction: column; gap: 0; position: absolute; top: var(--nav-h); left: 0; right: 0; background: rgba(6,10,18,.97); backdrop-filter: blur(20px); padding: 16px 0; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .hamburger { display: flex; }
  .hero-name { font-size: clamp(2.4rem, 9vw, 4rem); }
  .about-stats { flex-wrap: wrap; gap: 24px; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .tc-header { flex-direction: column; }
  .tc-meta { align-items: flex-start; }
  .hero-scroll { display: none; }
}
@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { text-align: center; justify-content: center; }
}
