/* =============================================
   CSS VARIABLES (Design Tokens)
   Changing these values changes the whole theme!
   ============================================= */
:root {
  --bg: #f5f7ff;
  --bg-alt: #eef0fb;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-light: #555577;
  --primary: #2d4af0;
  --primary-dark: #1a35c7;
  --accent: #f0a500;
  --border: #dde0f5;
  --shadow: 0 4px 20px rgba(45, 74, 240, 0.12);
  --radius: 12px;
  --transition: 0.3s ease;
}

/* Dark mode variables — applied when body has class "dark" */
body.dark {
  --bg: #0f1020;
  --bg-alt: #161830;
  --card: #1e2040;
  --text: #eef0fb;
  --text-light: #9999bb;
  --border: #2a2d50;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* =============================================
   BASE RESET
   ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* smooth jump when clicking nav links */
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color var(--transition), color var(--transition);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;           /* stays at top when scrolling */
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  background-color: var(--bg);
  border-bottom: 2px solid var(--border);
  z-index: 999;              /* above everything */
  transition: background-color var(--transition), box-shadow var(--transition);
}

/* Navbar gets a shadow when you scroll — added by JavaScript */
.navbar.scrolled {
  box-shadow: var(--shadow);
}

.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.nav-logo span {
  color: var(--accent);     /* ".dev" part is yellow */
}

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

.nav-links a {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  transition: color var(--transition);
}

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

/* Theme toggle button */
.theme-btn {
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.theme-btn:hover {
  background: var(--border);
}

/* Hamburger menu (shown on mobile) */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text);
}

/* =============================================
   REUSABLE BUTTON STYLES
   ============================================= */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: 2px solid var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px); /* slight lift on hover */
}

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

.btn-outline:hover {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  text-align: center;
}

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

.hero-content {
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.hero-name {
  font-size: 60px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-role {
  font-size: 24px;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* Typed text is the blue coloured part */
#typed-text {
  color: var(--primary);
  font-weight: 700;
}

/* Blinking cursor animation */
.cursor {
  color: var(--primary);
  animation: blink 0.8s infinite;
}

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

.hero-desc {
  font-size: 17px;
  color: var(--text-light);
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Large decorative blob in hero background */
.hero-blob {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  background-color: var(--primary);
  border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%;
  opacity: 0.08;
}

/* =============================================
   SECTION SHARED STYLES
   ============================================= */
.section {
  padding: 80px 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-alt {
  background-color: var(--bg-alt);
  max-width: 100%;
  padding: 80px 48px;
}

/* Inner container inside section-alt */
.section-alt > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

/* Blue underline decoration under title */
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--primary);
  margin: 10px auto 0;
  border-radius: 2px;
}

.section-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
  margin-bottom: 48px;
  margin-top: 8px;
}

/* =============================================
   ABOUT SECTION
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 40px;
}

.avatar-box {
  text-align: center;
}

/* The big emoji avatar */
.avatar {
  width: 180px;
  height: 180px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  margin: 0 auto 16px;
}

.avatar-badge {
  background-color: #22c55e; /* green */
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-block;
}

.about-text p {
  font-size: 16px;
  color: var(--text-light);
}

/* Stats row */
.stat-cards {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.stat {
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-light);
}

/* =============================================
   SKILLS SECTION
   ============================================= */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.skill-item {
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* Row with skill name and percentage */
.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

/* The grey track */
.skill-bar {
  height: 10px;
  background-color: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

/* The coloured fill — width animated by JavaScript */
.skill-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 999px;
  width: 0%;                /* starts at 0, JS animates to actual value */
  transition: width 1.2s ease;
}

/* Technology badges */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.tag {
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: border-color var(--transition);
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* =============================================
   PROJECTS SECTION
   ============================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);      /* lifts up on hover */
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.project-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.project-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* Tech tags on project cards */
.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.project-tags span {
  background-color: var(--bg-alt);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.project-links {
  display: flex;
  gap: 10px;
}

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.contact-item:hover {
  border-color: var(--primary);
}

.contact-icon {
  font-size: 28px;
}

.contact-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.contact-item p {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
}

/* Contact form */
.contact-form {
  background-color: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background-color: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background-color var(--transition);
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  background-color: var(--card);
}

/* Success message — hidden by default, shown by JS */
.form-success {
  display: none;
  color: #22c55e;
  font-weight: 600;
  margin-top: 14px;
  text-align: center;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-light);
  font-size: 14px;
  border-top: 2px solid var(--border);
  background-color: var(--bg);
}

.footer p + p {
  margin-top: 4px;
}

/* =============================================
   BACK TO TOP BUTTON
   ============================================= */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;                /* hidden by default */
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

/* Shown by JavaScript after scrolling down */
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/* =============================================
   RESPONSIVE (Mobile)
   ============================================= */
@media (max-width: 768px) {

  .navbar {
    padding: 14px 24px;
  }

  .nav-links {
    display: none;           /* hidden on mobile by default */
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--bg);
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
    gap: 16px;
  }

  /* JavaScript adds this class to show the menu */
  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: block;          /* visible on mobile */
  }

  .hero {
    padding: 100px 24px 60px;
    text-align: center;
  }

  .hero-name {
    font-size: 38px;
  }

  .hero-blob {
    display: none;           /* hide blob on mobile */
  }

  .hero-btns {
    justify-content: center;
  }

  .section {
    padding: 60px 24px;
  }

  .section-alt {
    padding: 60px 24px;
  }

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

  .stat-cards {
    justify-content: center;
  }

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

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

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