/* ===== CSS VARIABLES ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
  --shadow-hover: 0 8px 32px rgba(37, 99, 235, 0.16);
  --radius: 12px;
  --transition: 0.3s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(37, 99, 235, 0.25);
  --primary-light: #1e3a5f;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ===== UTILITY ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 48px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}
/* Avatar (Profile Image Circle) */
.avatar-inner {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #1e5ae0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text);
  transform: translateY(-2px);
}
.btn-full { width: 100%; justify-content: center; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}
[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.85);
}
.navbar.scrolled { box-shadow: var(--shadow); }

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--primary); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px; height: 38px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-alt); color: var(--primary); }

.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: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.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); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 7rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.hero-content { flex: 1; max-width: 600px; }

.hero-greeting {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero-name {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.hero-title .divider { margin: 0 0.5rem; color: var(--border); }
.hero-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero visual */
.hero-visual {
  position: relative;
  flex-shrink: 0;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.avatar-ring {
  width: 220px; height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  padding: 4px;
  animation: spin-slow 12s linear infinite;
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -2px;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.floating-badge {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 0.4rem;
  animation: float 3s ease-in-out infinite;
}
.badge-1 { top: 10px; right: 0; animation-delay: 0s; }
.badge-2 { bottom: 30px; right: -10px; animation-delay: 1s; }
.badge-3 { bottom: 10px; left: 0; animation-delay: 2s; }
.floating-badge i { color: var(--primary); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }

.about-info { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.info-item {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--text-muted); font-size: 0.95rem;
}
.info-item i { color: var(--primary); width: 16px; }

.about-languages h3 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.lang-item {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.lang-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.lang-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 4px;
  transition: width 1.2s ease;
}
.lang-level { color: var(--text-muted); font-size: 0.8rem; text-align: right; }

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.skill-category h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--primary);
}
.skill-item { margin-bottom: 1rem; }
.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.skill-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tools-icons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tool-chip {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 0.4rem;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.project-icon {
  width: 48px; height: 48px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
}
.project-card h3 { font-size: 1.1rem; font-weight: 700; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}
.project-links { display: flex; gap: 0.75rem; margin-top: 0.25rem; }
.project-links a {
  font-size: 0.875rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--primary);
}
.project-links a:hover { color: var(--primary-dark); }

/* ===== EDUCATION ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.timeline-content h3 { font-size: 1.1rem; margin: 0.4rem 0; }
.timeline-school {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== GITHUB ===== */
.github-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 600px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.github-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.github-avatar {
  width: 80px; height: 80px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  flex-shrink: 0;
}
.github-info h3 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.github-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}
.contact-info h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.contact-info p { color: var(--text-muted); margin-bottom: 1.5rem; }
.contact-links { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-links a {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition);
}
.contact-links a:hover { color: var(--primary); }
.contact-links i { color: var(--primary); width: 18px; }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-status {
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.2em;
  color: var(--primary);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer p { color: var(--text-muted); font-size: 0.875rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a {
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary); }

/* ===== SCROLL ANIMATIONS ===== */
.reveal, .fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible, .fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 0.75rem 0; }
  .hamburger { display: flex; }

  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 6rem;
    min-height: auto;
    padding-bottom: 3rem;
  }
  .hero-buttons { justify-content: center; }
  .hero-intro { margin: 0 auto 2rem; }
  .hero-visual { width: 200px; height: 200px; }
  .avatar-ring { width: 160px; height: 160px; }
  .avatar-inner { font-size: 2rem; }
  .badge-1 { top: 0; right: -10px; }
  .badge-2 { bottom: 10px; right: -20px; }
  .badge-3 { bottom: 0; left: -10px; }
  .scroll-down { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .github-card { flex-direction: column; text-align: center; }
  .footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .section { padding: 3.5rem 0; }
  .hero-name { font-size: 2.2rem; }
  .btn { padding: 0.65rem 1.2rem; font-size: 0.875rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}
