/* ============================================
   GOOGLE FONT — must stay first
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --bg-primary:     #f0f4f8;
  --bg-secondary:   #ffffff;
  --text-primary:   #1a1a2e;
  --text-secondary: #555;
  --text-muted:     #777;
  --heading-color:  #1a1a2e;
  --nav-bg:         rgba(255, 255, 255, 0.85);
  --nav-shadow:     0 2px 20px rgba(0, 0, 0, 0.08);
  --card-bg:        #ffffff;
  --footer-bg:      #0f0c29;
  --footer-text:    #718096;
  --accent:         #667eea;
  --accent-2:       #764ba2;
  --timeline-line:  #e2e8f0;
  --timeline-card:  #ffffff;
}

body.dark-mode {
  --bg-primary:     #0f0c29;
  --bg-secondary:   #1a1635;
  --text-primary:   #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted:     #718096;
  --heading-color:  #e2e8f0;
  --nav-bg:         rgba(15, 12, 41, 0.9);
  --nav-shadow:     0 2px 20px rgba(0, 0, 0, 0.5);
  --card-bg:        #1a1635;
  --footer-bg:      #08061a;
  --footer-text:    #4a5568;
  --timeline-line:  #2d2060;
  --timeline-card:  #1a1635;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  padding-top: 65px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   PAGE LOADER
   Full-screen intro that fades out on load
   ============================================ */
#page-loader {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f0c29, #302b63);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
  50%       { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(255, 215, 0, 0); }
}

.loader-track {
  width: 160px;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #f093fb);
  border-radius: 3px;
  animation: loaderBar 0.9s ease forwards;
}

@keyframes loaderBar {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ============================================
   SCROLL PROGRESS BAR
   Lives inside the navbar at the very top
   ============================================ */
.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #667eea, #f093fb, #4facfe);
  transition: width 0.08s linear;
  z-index: 1;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 22px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 4px;
}

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

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dark-toggle {
  background: none;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.3s ease;
}

.dark-toggle:hover {
  border-color: var(--accent);
  transform: rotate(25deg);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ── */
@media (max-width: 700px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    flex-direction: column;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }

  .nav-links.open { display: flex; }

  .nav-links li a {
    display: block;
    padding: 14px 24px;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
  }
}

/* ============================================
   SCROLL FADE-IN ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-grid .card:nth-child(1) { transition-delay: 0.05s; }
.card-grid .card:nth-child(2) { transition-delay: 0.15s; }
.card-grid .card:nth-child(3) { transition-delay: 0.25s; }
.card-grid .card:nth-child(4) { transition-delay: 0.35s; }

.skills-list .skill:nth-child(1) { transition-delay: 0.05s; }
.skills-list .skill:nth-child(2) { transition-delay: 0.15s; }
.skills-list .skill:nth-child(3) { transition-delay: 0.25s; }
.skills-list .skill:nth-child(4) { transition-delay: 0.35s; }
.skills-list .skill:nth-child(5) { transition-delay: 0.45s; }

.timeline-item:nth-child(1) { transition-delay: 0.05s; }
.timeline-item:nth-child(2) { transition-delay: 0.15s; }
.timeline-item:nth-child(3) { transition-delay: 0.25s; }
.timeline-item:nth-child(4) { transition-delay: 0.35s; }
.timeline-item:nth-child(5) { transition-delay: 0.45s; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(-45deg, #0f0c29, #302b63, #667eea, #764ba2);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  color: white;
  text-align: center;
  padding: 100px 20px 110px;
  min-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating background orbs */
.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.22;
  pointer-events: none;
}

.orb-1 {
  width: 480px; height: 480px;
  background: #a78bfa;
  top: -130px; right: -110px;
  animation: floatOrb 11s ease-in-out infinite;
}

.orb-2 {
  width: 360px; height: 360px;
  background: #60a5fa;
  bottom: -110px; left: -90px;
  animation: floatOrb 14s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-28px) scale(1.06); }
}

/* Floating code symbols — CSS-only, no JS */
.code-symbols-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cs {
  position: absolute;
  bottom: -40px;
  left: var(--x);
  color: white;
  font-family: 'Courier New', monospace;
  font-size: var(--size);
  font-weight: 700;
  opacity: 0.12;
  animation: symbolFloat var(--dur) linear var(--delay) infinite;
}

@keyframes symbolFloat {
  0%   { transform: translateY(0)      rotate(0deg);  opacity: 0; }
  5%   {                                              opacity: 0.12; }
  90%  {                                              opacity: 0.12; }
  100% { transform: translateY(-620px) rotate(15deg); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

/* Avatar */
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px;
  animation: glowPulse 3s ease-in-out infinite;
}

.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,215,0,0.3), 0 0 28px rgba(255,215,0,0.2); }
  50%       { box-shadow: 0 0 0 8px rgba(255,215,0,0.15), 0 0 52px rgba(255,215,0,0.38); }
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.highlight { color: #ffd700; }

.tagline {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 34px;
  min-height: 1.8em;
}

#typewriter::after {
  content: '|';
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.github-btn {
  display: inline-block;
  padding: 13px 32px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.github-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  background: linear-gradient(135deg, #0f0c29, #1a1635);
  padding: 64px 20px;
  text-align: center;
}

.stats-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-top {
  display: flex;
  align-items: flex-start;
}

.stat-number {
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-size: 1.8rem;
  font-weight: 700;
  padding-top: 8px;
  background: linear-gradient(135deg, #667eea, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 8px;
  margin-bottom: 0;
}

/* ============================================
   SHARED LAYOUT
   ============================================ */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 70px 24px;
}

h2 {
  font-size: 1.9rem;
  margin-bottom: 28px;
  color: var(--heading-color);
}

.section-title-light { color: white; }

p {
  margin-bottom: 14px;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ============================================
   ABOUT
   ============================================ */
.about { background-color: var(--bg-secondary); }
.about strong { color: var(--accent); }

/* ============================================
   SKILLS
   ============================================ */
.skills {
  background: linear-gradient(135deg, #0f0c29 0%, #1a1635 60%, #2d2060 100%);
}

.skills h2 { color: #e2e8f0; }

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e0;
}

.skill-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  height: 10px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 50px;
  transition: width 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill:nth-child(1) .skill-fill { background: linear-gradient(90deg, #667eea, #764ba2); }
.skill:nth-child(2) .skill-fill { background: linear-gradient(90deg, #f093fb, #f5576c); }
.skill:nth-child(3) .skill-fill { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.skill:nth-child(4) .skill-fill { background: linear-gradient(90deg, #43e97b, #38f9d7); }
.skill:nth-child(5) .skill-fill { background: linear-gradient(90deg, #fa709a, #fee140); }

/* ============================================
   LEARNING
   ============================================ */
.learning {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 55%, #f093fb 100%);
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 55%, #24243e 100%);
}

/* ============================================
   CARD GRID & CARDS
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 30px 22px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.25s ease;
  /* 3D tilt needs this */
  transform-style: preserve-3d;
  will-change: transform;
}

.glass-card {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card:hover {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.3);
}

.card-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

/* Glass card overrides — must come AFTER .card p to win the cascade */
.glass-card h3 { color: white; }
.glass-card p  { color: rgba(255, 255, 255, 0.9); }

.project-link {
  display: inline-block;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.project-link:hover { color: white; border-color: white; }

.coming-soon { opacity: 0.45; }

/* ============================================
   TIMELINE
   ============================================ */
.timeline-section {
  background: var(--bg-primary);
}

.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 32px;
}

/* Vertical line running down the left */
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, #667eea, #f093fb, #667eea);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

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

/* Circle dot on the timeline line */
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: 3px solid var(--bg-primary);
  z-index: 1;
}

/* Pulsing dot for the "coming next" item */
.pulse-dot {
  background: #f093fb;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 147, 251, 0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(240, 147, 251, 0); }
}

.timeline-card {
  background: var(--timeline-card);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  border-left: 4px solid #667eea;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.timeline-card-next {
  border-left-color: #f093fb;
  background: linear-gradient(135deg, var(--timeline-card), rgba(240,147,251,0.05));
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.timeline-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 6px;
}

.timeline-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 55%, #1a1635 100%);
  padding: 70px 0;
}

.contact-sub {
  color: rgba(255,255,255,0.7);
  margin-top: -14px;
  margin-bottom: 36px;
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 12px 16px;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.35);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.8);
  background: rgba(255, 255, 255, 0.12);
}

.submit-btn {
  align-self: flex-start;
  padding: 13px 32px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(102, 126, 234, 0.45);
}

.form-success {
  text-align: center;
  padding: 50px 20px;
  color: white;
}

.success-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.form-success h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.form-success p {
  color: rgba(255,255,255,0.7);
}

.hidden { display: none; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 38px 20px;
  font-size: 0.9rem;
}

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

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: white; }
