/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #f0f4ff;
  --bg2:      #e8f0fb;
  --surface:  #ffffff;
  --border:   #d0daf0;
  --accent:   #2563eb;
  --accent2:  #1a4db8;
  --teal:     #00d4aa;
  --teal2:    #00b894;
  --text:     #0f1b35;
  --muted:    #4a5a7a;
  --white:    #ffffff;
  --radius:   15px;
  --nav-h:    58px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
  color: white;
}
.btn:hover {
  background: white;
  color: var(--accent);
  border-color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}
/* override for contact form submit */
.contact .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: white;
  border: none;
  width: 100%;
  justify-content: center;
}
.contact .btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102,126,234,0.3);
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: white;
}

/* ============================================================
   SECTION COMMON
   ============================================================ */
section { padding: 100px 0; position: relative; overflow: hidden; }

/* Graph-paper grid background on non-hero sections */
section:not(.hero):not(.social-section) {
  background-image:
    linear-gradient(rgba(37,99,235,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.about    { background-color: #edf2ff; }
.skills   { background-color: #f0f4ff; }
.projects { background-color: #e8effe; }
.contact  { background-color: #f0f4ff; }

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text);
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section-title.visible { opacity: 1; transform: translateY(0); }
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60px; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 2px;
  transition: transform 0.5s ease 0.4s;
}
.section-title.visible::after { transform: translateX(-50%) scaleX(1); }

/* Sparkline divider between sections */
.section-divider {
  width: 100%;
  height: 40px;
  display: block;
  overflow: hidden;
  line-height: 0;
}
.section-divider svg { display: block; width: 100%; height: 40px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; width: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
/* Transparent state while over hero */
.navbar.over-hero {
  background: rgba(15,27,53,0.15);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
}
/* Frosted glass after scrolling past hero — tints per section */
.navbar.scrolled {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 4px 32px rgba(37,99,235,0.12);
  border-bottom: 1px solid rgba(37,99,235,0.1);
}
.navbar.scrolled.tint-about    { background: rgba(237,242,255,0.97); border-bottom-color: rgba(37,99,235,0.12); }
.navbar.scrolled.tint-skills   { background: rgba(240,244,255,0.97); border-bottom-color: rgba(37,99,235,0.10); }
.navbar.scrolled.tint-projects { background: rgba(232,239,254,0.97); border-bottom-color: rgba(37,99,235,0.14); }
.navbar.scrolled.tint-contact  { background: rgba(240,244,255,0.97); border-bottom-color: rgba(0,212,170,0.18); }
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; justify-content: space-between; align-items: center;
  height: var(--nav-h);
}
.logo-text { font-size: 1.4rem; font-weight: 700; color: var(--accent); transition: color 0.4s ease; }
.over-hero .logo-text { color: rgba(255,255,255,0.95); }

.nav-menu { display: flex; list-style: none; gap: 1.8rem; }
.nav-link { color: var(--text); font-weight: 500; transition: color 0.3s; position: relative; font-size: 0.95rem; }
.over-hero .nav-link { color: rgba(255,255,255,0.85); }
.nav-link::after { content:''; position:absolute; width:0; height:2px; bottom:-4px; left:0; background: linear-gradient(90deg, var(--accent), var(--teal)); transition:width 0.3s; }
.over-hero .nav-link::after { background: linear-gradient(90deg, rgba(255,255,255,0.9), var(--teal)); }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.over-hero .nav-link:hover, .over-hero .nav-link.active { color: white; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.hamburger { display: none; flex-direction: column; cursor: pointer; }
.hamburger span { width: 25px; height: 3px; background: var(--text); margin: 3px 0; transition: background 0.4s, transform 0.3s; border-radius: 2px; }
.over-hero .hamburger span { background: rgba(255,255,255,0.9); }
/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  background: linear-gradient(135deg, #0f1b35 0%, #1a2d5a 60%, #0d2240 100%);
  color: white;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(80,160,255,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 75%, rgba(0,212,170,0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 10%, rgba(80,160,255,0.06) 0%, transparent 40%);
  animation: bgPulse 12s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bgPulse { 0%,100%{opacity:1} 50%{opacity:0.75} }

/* Animated bar chart in hero background */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

.hero-container { position:relative; z-index:2; width:100%; max-width:1200px; margin:0 auto; padding:0 20px; }
.hero-content { max-width:640px; }

/* Hero entrance animations */
.hero-title {
  font-size: 3.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.15;
  opacity: 0; transform: scale(0.85) translateY(30px);
  animation: heroScale 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards 0.5s;
}
.highlight { color: rgba(255,255,255,0.92); }
.hero-subtitle {
  font-size: 1.4rem; font-weight: 400; margin-bottom: 1.2rem; opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.7s ease forwards 0.9s;
}
.hero-description {
  font-size: 1.1rem; margin-bottom: 2.5rem; line-height: 1.7;
  color: rgba(255,255,255,0.85);
  opacity: 0; transform: translateY(20px);
  animation: heroIn 0.7s ease forwards 1.1s;
}
.hero-buttons {
  display: flex; gap: 1rem; flex-wrap: wrap;
  opacity: 0; transform: translateY(20px);
  animation: heroIn 0.7s ease forwards 1.3s;
}

@keyframes heroIn    { to { opacity: 1; transform: translateY(0); } }
@keyframes heroScale { to { opacity: 1; transform: scale(1) translateY(0); } }

.scroll-indicator {
  position: absolute; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 2; opacity: 0;
  animation: heroIn 0.5s ease forwards 1.8s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.scroll-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(0,212,170,0.9);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
.scroll-dot:nth-child(2) { animation-delay: 0.2s; opacity: 0.6; width: 6px; height: 6px; }
.scroll-dot:nth-child(3) { animation-delay: 0.4s; opacity: 0.3; width: 4px; height: 4px; }
@keyframes scrollPulse {
  0%,100% { transform: translateY(0); opacity: 1; }
  50%     { transform: translateY(5px); opacity: 0.4; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-content { max-width: 800px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.about-text { margin-bottom: 2.5rem; }
.about-text p { font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--muted); line-height: 1.8; }
.about-stats { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-number {
  display: inline-block;
  font-size: 2.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}
.stat-cursor { display: inline-block; width: 3px; height: 2rem; background: var(--teal); margin-left: 2px; vertical-align: middle; animation: blink 0.8s step-end infinite; }
.stat-cursor.done { display: none; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.stat-label { display: block; font-size: 1rem; color: var(--muted); font-weight: 500; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
  gap: 2rem; margin-top: 2rem;
  perspective: 1000px;
  position: relative; z-index: 1;
}
.skill-card {
  background: white; padding: 2.5rem 2rem; border-radius: var(--radius);
  text-align: center; box-shadow: 0 5px 20px rgba(37,99,235,0.07);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
}
.skill-card:hover {
  box-shadow: 0 20px 50px rgba(37,99,235,0.18);
  border-color: rgba(37,99,235,0.25);
}
.skill-icon {
  font-size: 2.8rem; color: var(--accent); margin-bottom: 1.2rem;
  transition: transform 0.3s ease, color 0.3s ease;
}
.skill-card:hover .skill-icon { transform: scale(1.15); color: var(--teal); }
.skill-card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.8rem; color: var(--text); }
.skill-card p  { color: var(--muted); line-height: 1.6; font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Proficiency bar — removed */

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px,1fr));
  gap: 2rem; margin-top: 2rem;
  perspective: 1000px;
  position: relative; z-index: 1;
}
.project-card {
  background: white; border-radius: var(--radius); padding: 2rem;
  box-shadow: 0 5px 20px rgba(102,126,234,0.08);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative; overflow: hidden;
}
.project-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s ease;
}
.project-card:hover::after { transform: scaleX(1); }
.project-card:hover { box-shadow: 0 20px 50px rgba(102,126,234,0.18); }
.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.project-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); flex: 1; padding-right: 10px; }
.project-status { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.project-status.status-learning  { background: linear-gradient(135deg, var(--teal), var(--teal2)); }
.project-status.status-academic  { background: linear-gradient(135deg, #f093fb, #f5576c); }
.project-description { color: var(--muted); line-height: 1.65; margin-bottom: 1.5rem; flex: 1; font-size: 0.93rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tech-tag { background: #eef0f5; color: #6b7a99; padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.78rem; font-weight: 500; border: 1px solid #dde2ee; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.project-card:hover .tech-tag { background: #e0e8ff; color: var(--accent); border-color: rgba(37,99,235,0.25); }
.project-links { margin-top: auto; }
.project-link { color: var(--accent); font-weight: 600; transition: gap 0.2s, color 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.project-link:hover { color: var(--teal); gap: 10px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; position: relative; z-index: 1; }
.contact-info h3 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.contact-info p { color: var(--muted); line-height: 1.6; margin-bottom: 2rem; }
.contact-details { display: flex; flex-direction: column; gap: 1rem; }
.contact-item { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.contact-item i { color: var(--teal); font-size: 1.2rem; width: 20px; }
.contact-form-container {
  background: white; padding: 2.5rem; border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(102,126,234,0.1);
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 1.5rem; }
.form-group input, .form-group textarea {
  width: 100%; padding: 1rem; border: 2px solid var(--border); border-radius: 10px;
  font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s; font-family: inherit; color: var(--text);
  background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,212,170,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.contact .btn-primary { background: linear-gradient(135deg, var(--accent), var(--teal)); color: white; width: 100%; justify-content: center; border: none; }
.contact .btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(102,126,234,0.3); }

/* ============================================================
   FOOTER (combined social + copyright)
   ============================================================ */
.footer {
  background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%);
  color: white;
  padding: 28px 0;
  text-align: center;
  border-top: 1px solid rgba(102,126,234,0.2);
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a {
  color: rgba(255,255,255,0.55);
  font-size: 1rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.footer-social a:hover { color: white; border-color: var(--teal); background: rgba(0,212,170,0.15); transform: translateY(-2px); }
.footer-copy { font-size: 0.82rem; opacity: 0.45; }
.footer-copy span { opacity: 0.7; }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

.skills-grid .skill-card:nth-child(1) { transition-delay: 0.05s; }
.skills-grid .skill-card:nth-child(2) { transition-delay: 0.12s; }
.skills-grid .skill-card:nth-child(3) { transition-delay: 0.19s; }
.skills-grid .skill-card:nth-child(4) { transition-delay: 0.26s; }
.skills-grid .skill-card:nth-child(5) { transition-delay: 0.33s; }

.projects-grid .project-card:nth-child(1) { transition-delay: 0.05s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.12s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.19s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.26s; }
.projects-grid .project-card:nth-child(5) { transition-delay: 0.33s; }

/* ============================================================
   KEYFRAMES
   ============================================================ */
/* bounce removed — replaced by scrollPulse */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-menu {
    position: fixed; left: -100%; top: var(--nav-h);
    flex-direction: column; background: white; width: 100%;
    text-align: center; transition: left 0.3s ease;
    box-shadow: 0 10px 27px rgba(0,0,0,0.08); padding: 2rem 0;
    z-index: 999;
  }
  .nav-menu.active { left: 0; }
  .nav-menu li { padding: 0.4rem 0; }
  /* Mobile dropdown always has white bg — force dark text regardless of hero state */
  .over-hero .nav-menu .nav-link { color: var(--text) !important; }
  .over-hero .nav-menu .nav-link:hover,
  .over-hero .nav-menu .nav-link.active { color: var(--accent) !important; }
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1.2rem; }
  .hero-description { font-size: 1rem; }
  .hero-buttons { justify-content: center; }
  .section-title { font-size: 2rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-content { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
  section { padding: 60px 0; }
  .hero-title { font-size: 2rem; }
  .btn { padding: 12px 24px; font-size: 0.9rem; }
  .skill-card, .project-card { padding: 1.5rem; }
  .contact-form-container { padding: 1.5rem; }
  .about-stats { gap: 2rem; }
}
