/* ======================================================
   RAJ MALI — PORTFOLIO
   Clean White / Minimalistic / Interactive
   ====================================================== */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:          #fafafa;
  --bg-alt:      #f0f0f3;
  --surface:     #ffffff;
  --text:        #1a1a2e;
  --text-light:  #555568;
  --text-muted:  #8888a0;
  --accent:      #1a1a2e;
  --accent-soft: #e8e8f0;
  --border:      #e4e4ec;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-hover:0 14px 44px rgba(0,0,0,0.10), 0 4px 14px rgba(0,0,0,0.05);
  --radius:      12px;
  --radius-sm:   8px;
  --nav-height:  64px;
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- CANVAS BACKGROUND ---------- */
#circuit-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- NAVIGATION ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: var(--transition);
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo .dot {
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--text);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(250, 250, 250, 0.97);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  z-index: 999;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 0;
}

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 720px;
}

.hero-greeting {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-typing-wrapper {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  min-height: 2.2em;
}

.hero-static {
  color: var(--text-light);
}

.hero-typed {
  color: var(--text);
  font-weight: 600;
}

.cursor {
  font-weight: 300;
  animation: blink 1s step-end infinite;
  color: var(--text-muted);
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 580px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.8rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--text);
  color: white;
}

.btn-primary:hover {
  background: #2d2d4a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  text-align: center;
  animation: float 3s ease-in-out infinite;
}

.scroll-indicator p {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.5rem;
}

.mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--border);
  border-radius: 12px;
  margin: 0 auto;
  position: relative;
}

.wheel {
  width: 3px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.3; transform: translateX(-50%) translateY(10px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- SECTIONS ---------- */
.section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--text);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition);
}

.highlight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.highlight-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-icon svg {
  width: 18px;
  height: 18px;
  color: var(--text);
}

.highlight-card h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.highlight-card p {
  font-size: 0.825rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ---------- RESEARCH ---------- */
.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition);
}

.research-card:hover {
  box-shadow: var(--shadow-md);
}

.research-badge {
  display: inline-block;
  background: var(--text);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.badge-active {
  background: #2563eb;
}

.research-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.research-authors {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.research-venue {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.research-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

.research-stat {
  text-align: center;
}

.research-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  letter-spacing: -0.5px;
}

.research-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.research-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.research-list {
  list-style: none;
  padding: 0;
}

.research-list li {
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
}

.research-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.research-tags span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ---------- PROJECTS ---------- */
.project-filter {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.project-card.hidden {
  display: none;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.project-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.tag-research { color: #2563eb; background: #eff6ff; }
.tag-software { color: #059669; background: #ecfdf5; }
.tag-hw { color: #d97706; background: #fffbeb; }

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.2px;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.65;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tech span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.skill-category:hover {
  box-shadow: var(--shadow-md);
}

.skill-category h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-alt);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.skill-tags span:hover {
  background: var(--text);
  color: white;
}

/* ---------- EXPERIENCE TIMELINE ---------- */
.timeline {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--text);
  z-index: 1;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-md);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-company {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content li {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 0.25rem 0 0.25rem 1rem;
  position: relative;
}

.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

/* ---------- ACHIEVEMENTS ---------- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.achievement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.achievement-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.achievement-card p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ---------- CERTIFICATIONS ---------- */
.cert-grid {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.cert-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--text-muted);
}

.cert-icon {
  color: var(--text);
  font-size: 0.6rem;
}

/* ---------- CONTACT ---------- */
.contact-container {
  text-align: center;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto 2.5rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 750px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--text);
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.contact-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

/* ---------- FOOTER ---------- */
.footer {
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.footer strong {
  color: var(--text);
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 1px;
}

/* ---------- REVEAL ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-name {
    font-size: 2.8rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .research-highlights {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-links {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4rem 0;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .research-highlights {
    grid-template-columns: 1fr 1fr;
  }

  .research-card {
    padding: 1.5rem;
  }
}
