/* ============================================================
   HARSIMRAN SINGH — AI ENGINEER PORTFOLIO
   Design System + Full Stylesheet
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* surfaces */
  --bg-primary: #06060e;
  --bg-secondary: #0c0c1d;
  --bg-card: #0f0f23;
  --bg-card-hover: #141432;
  --bg-glass: rgba(15, 15, 35, .55);

  /* accents */
  --accent: #00e5ff;
  --accent-dim: #00b8d4;
  --accent-glow: rgba(0, 229, 255, .25);
  --accent2: #7c4dff;
  --accent2-glow: rgba(124, 77, 255, .25);
  --neon-green: #39ff14;
  --neon-pink: #ff2e97;
  --neon-orange: #ff6d00;

  /* text */
  --text-primary: #e8eaf6;
  --text-secondary: #9fa8da;
  --text-tertiary: #5c6bc0;

  /* borders */
  --border: rgba(255, 255, 255, .06);
  --border-accent: rgba(0, 229, 255, .2);

  /* misc */
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
  --transition: .35s cubic-bezier(.4, 0, .2, 1);

  /* type */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--neon-pink);
}

ul {
  list-style: none;
}

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

button,
input,
textarea {
  font-family: inherit;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

/* ---------- Background Effects ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 800px 600px at 20% 10%, rgba(0, 229, 255, .07), transparent 60%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(124, 77, 255, .06), transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(255, 46, 151, .04), transparent 60%);
  pointer-events: none;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .03;
  background-image:
    linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-label {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 48px;
}

.section-title .highlight {
  color: var(--accent);
  position: relative;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s ease, transform .8s ease;
}

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

.reveal-left {
  transform: translateX(-60px);
}

.reveal-right {
  transform: translateX(60px);
}

.reveal-left.visible,
.reveal-right.visible {
  transform: translateX(0);
}

/* ---------------------------------------------------------------------------
   NAVIGATION
   --------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: background .4s, box-shadow .4s, padding .4s;
}

.navbar.scrolled {
  background: rgba(6, 6, 14, .88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 30px rgba(0, 0, 0, .4);
  padding: 12px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width var(--transition);
}

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

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

.nav-cta {
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff !important;
  border: none;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.nav-cta::after {
  display: none !important;
}

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

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

/* ---------------------------------------------------------------------------
   HERO SECTION
   --------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 750px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 50px;
  background: rgba(0, 229, 255, .08);
  border: 1px solid rgba(0, 229, 255, .2);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
  animation: fadeInDown .8s ease .2s both;
}

.hero-badge .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, .5);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(57, 255, 20, 0);
  }
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp .8s ease .3s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 600px;
  margin-bottom: 36px;
  animation: fadeInUp .8s ease .5s both;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
  animation: fadeInUp .8s ease .6s both;
}

.hero-stat .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.hero-stat .stat-label {
  font-size: .75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp .8s ease .7s both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .3s, transform .25s;
}

.btn-secondary:hover {
  background: rgba(0, 229, 255, .08);
  transform: translateY(-3px);
}

/* hero orbit decoration */
.hero-visual {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  z-index: 1;
  display: none;
  /* shown on lg screens */
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, .1);
  animation: orbit-spin 25s linear infinite;
}

.orbit-ring:nth-child(1) {
  inset: 0;
}

.orbit-ring:nth-child(2) {
  inset: 60px;
  animation-duration: 20s;
  animation-direction: reverse;
  border-color: rgba(124, 77, 255, .1);
}

.orbit-ring:nth-child(3) {
  inset: 120px;
  animation-duration: 15s;
  border-color: rgba(255, 46, 151, .08);
}

.orbit-node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- typing text ----- */
.typed-wrapper {
  display: inline;
}

.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink .7s step-end infinite;
}

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

/* entry anims */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------------
   SKILLS MARQUEE
   --------------------------------------------------------------------------- */
.skills-bar {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  background: rgba(12, 12, 29, .6);
}

.skills-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.skills-track:hover {
  animation-play-state: paused;
}

.skill-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.skill-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------------------------------------
   EXPERIENCE / TIMELINE
   --------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.timeline-item:hover {
  border-color: var(--border-accent);
  transform: translateX(6px);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-role {
  font-size: 1.15rem;
  font-weight: 700;
}

.timeline-company {
  font-size: .9rem;
  color: var(--accent);
  font-weight: 600;
}

.timeline-meta {
  font-size: .78rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.timeline-bullets {
  margin-top: 14px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.timeline-bullets li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   PROJECTS GRID
   --------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px 28px;
  transition: transform .45s ease, box-shadow .45s ease, border-color .45s ease;
  transform-style: preserve-3d;
  perspective: 800px;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 229, 255, .04), rgba(124, 77, 255, .04));
  opacity: 0;
  transition: opacity .4s;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35), 0 0 30px var(--accent-glow);
  border-color: var(--border-accent);
}

.project-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(0, 229, 255, .12), rgba(124, 77, 255, .12));
  border: 1px solid rgba(0, 229, 255, .15);
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.project-card .project-subtitle {
  font-size: .78rem;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 14px;
}

.project-card p {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.project-tags span {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  background: rgba(0, 229, 255, .08);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, .12);
}

.project-metrics {
  display: flex;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.project-metrics .metric {
  font-size: .75rem;
  color: var(--text-tertiary);
}

.project-metrics .metric strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   EDUCATION
   --------------------------------------------------------------------------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.edu-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.edu-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
}

.edu-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.edu-card .edu-degree {
  font-size: .9rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.edu-card .edu-meta {
  font-size: .78rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------------
   CERTIFICATIONS
   --------------------------------------------------------------------------- */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.cert-item:hover {
  border-color: var(--border-accent);
  transform: translateX(6px);
}

.cert-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 229, 255, .1), rgba(124, 77, 255, .1));
  font-size: 1rem;
}

.cert-item .cert-name {
  font-size: .88rem;
  font-weight: 600;
}

.cert-item .cert-issuer {
  font-size: .75rem;
  color: var(--text-tertiary);
}

/* ---------------------------------------------------------------------------
   CONTACT SECTION
   --------------------------------------------------------------------------- */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-info p {
  font-size: .92rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.contact-link:hover {
  color: var(--accent);
}

.contact-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-form {
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-submit .btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15), transparent);
  transition: left .6s;
}

.btn-submit:hover .btn-shine {
  left: 100%;
}

/* ---------------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------------- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

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

.footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

.footer .footer-links a {
  font-size: .82rem;
  color: var(--text-secondary);
}

/* ---- Floating 3D Avatar Prompt ---- */
.chat-avatar-prompt {
  position: fixed;
  bottom: 106px;
  right: 73px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  animation: avatarPromptEntry 0.8s cubic-bezier(.4, 0, .2, 1) 2s both;
}

.chat-avatar-prompt.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
  transition: opacity .35s, transform .35s;
}

/* Speech bubble */
.chat-avatar-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 14px 14px 4px 14px;
  padding: 10px 16px;
  max-width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4), 0 0 20px rgba(0, 229, 255, .08);
  position: relative;
  animation: bubblePulse 3s ease-in-out infinite 3s;
  cursor: pointer;
  pointer-events: auto;
}

.chat-avatar-bubble-text {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
  display: inline-block;
  overflow: hidden;
  animation: typeReveal 1.5s steps(40, end) 2.8s both;
  transition: opacity .35s ease, transform .35s ease;
}

.chat-avatar-bubble-tail {
  position: absolute;
  bottom: -6px;
  right: 16px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--bg-card);
  filter: drop-shadow(0 1px 0 rgba(0, 229, 255, .2));
}

/* Avatar figure */
.chat-avatar-figure {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 255, .12), rgba(124, 77, 255, .08));
  box-shadow: 0 0 20px rgba(0, 229, 255, .25), 0 0 40px rgba(124, 77, 255, .12);
  animation: figFloat 3s ease-in-out infinite;
  position: relative;
  pointer-events: auto;
  cursor: pointer;
}

.chat-avatar-figure::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 229, 255, .35), rgba(124, 77, 255, .35), rgba(255, 46, 151, .2), rgba(0, 229, 255, .35));
  z-index: -1;
  animation: avatar-ring-spin 6s linear infinite;
}

.chat-avatar-figure::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, .15) 0%, transparent 70%);
  z-index: -2;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes avatarPromptEntry {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes figFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-4px) rotate(1deg);
  }

  75% {
    transform: translateY(2px) rotate(-1deg);
  }
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: .5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes bubblePulse {

  0%,
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4), 0 0 20px rgba(0, 229, 255, .08);
  }

  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4), 0 0 28px rgba(0, 229, 255, .18);
  }
}

@keyframes typeReveal {
  from {
    max-width: 0;
  }

  to {
    max-width: 300px;
  }
}

/* FAB — hidden, avatar replaces it */
.chat-fab {
  display: none;
}

/* ---- Chat Window ---- */
.chat-window {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 390px;
  max-height: 540px;
  border-radius: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, .6),
    0 0 40px rgba(0, 229, 255, .06),
    inset 0 1px 0 rgba(255, 255, 255, .03);
  display: flex;
  flex-direction: column;
  transform: scale(.92) translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
  overflow: hidden;
}

.chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ---- Chat Header ---- */
.chat-header {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.chat-header h4 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.chat-header span {
  font-size: .72rem;
  color: var(--text-tertiary);
  display: block;
  margin-top: 1px;
}

/* ---- Close Button ---- */
.chat-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-tertiary);
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s, color .25s, border-color .25s;
}

.chat-close-btn:hover {
  background: rgba(0, 229, 255, .1);
  border-color: rgba(0, 229, 255, .25);
  color: var(--accent);
}

/* ---- 3D Avatar in header ---- */
.chat-avatar-3d {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 255, .12), rgba(124, 77, 255, .08));
  box-shadow: 0 0 12px rgba(0, 229, 255, .15);
  animation: avatar-float 3s ease-in-out infinite;
  position: relative;
}

.chat-avatar-3d::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 229, 255, .25), rgba(124, 77, 255, .2), rgba(0, 229, 255, .25));
  z-index: -1;
  animation: avatar-ring-spin 6s linear infinite;
}

@keyframes avatar-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes avatar-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Chat Messages ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, .15) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, .15);
  border-radius: 4px;
}

.chat-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .84rem;
  line-height: 1.6;
  animation: fadeInUp .3s ease;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
}

/* --- Markdown styles inside bot messages --- */
.chat-msg.bot strong {
  color: var(--text-primary);
  font-weight: 700;
}

.chat-msg.bot em {
  color: var(--accent);
  font-style: italic;
}

.chat-msg.bot .chat-inline-code {
  font-family: var(--font-mono);
  font-size: .78rem;
  background: rgba(0, 229, 255, .06);
  border: 1px solid rgba(0, 229, 255, .1);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.chat-msg.bot .chat-code-block {
  font-family: var(--font-mono);
  font-size: .76rem;
  background: rgba(6, 6, 14, .85);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0;
  overflow-x: auto;
  color: var(--text-secondary);
  line-height: 1.5;
}

.chat-msg.bot .chat-code-block code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.chat-msg.bot .chat-list {
  margin: 6px 0 6px 16px;
  padding: 0;
}

.chat-msg.bot ul.chat-list {
  list-style: none;
}

.chat-msg.bot ul.chat-list li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 4px;
}

.chat-msg.bot ul.chat-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: .8rem;
}

.chat-msg.bot ol.chat-list {
  list-style: decimal;
  padding-left: 18px;
}

.chat-msg.bot ol.chat-list li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.chat-msg.bot ol.chat-list li::marker {
  color: var(--accent);
  font-weight: 600;
}

.chat-msg.bot br {
  display: block;
  content: '';
  margin-top: 4px;
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typing-bounce 1.4s ease infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: .2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-5px);
  }
}

/* ---- Chat Input ---- */
.chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: .84rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}

.chat-input-area input:focus {
  border-color: rgba(0, 229, 255, .3);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, .08);
}

.chat-input-area input::placeholder {
  color: var(--text-tertiary);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}

.chat-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0, 229, 255, .2);
}

/* ---------------------------------------------------------------------------
   MOBILE NAV OVERLAY
   --------------------------------------------------------------------------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(6, 6, 14, .95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay a {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------------- */
@media (min-width:1024px) {
  .hero-visual {
    display: block;
  }
}

@media (max-width:1023px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .hero-stats {
    gap: 24px;
  }

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

@media (max-width:767px) {
  .section {
    padding: 60px 0;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .hero-stat .stat-value {
    font-size: 1.4rem;
  }

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

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

  .chat-window {
    width: calc(100% - 24px);
    right: 12px;
    bottom: 12px;
    max-height: 480px;
    border-radius: 16px;
  }

  .chat-avatar-prompt {
    bottom: 78px;
    right: 16px;
  }

  .chat-avatar-figure {
    width: 50px;
    height: 50px;
  }

  .chat-avatar-figure svg {
    width: 44px;
    height: 44px;
  }

  .chat-avatar-bubble {
    max-width: 180px;
    padding: 8px 12px;
  }

  .chat-avatar-bubble-text {
    font-size: .76rem;
  }
}

@media (max-width:480px) {
  .container {
    padding: 0 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}