/* =====================================================
   CSS VARIABLES (THEME COLORS & GLOBAL TOKENS)
   Centralized color management for light & dark mode
===================================================== */
:root {
  --bg: #f5f7fa;         
  --text: #333;           
  --card: #ffffff;      
  --primary: #4f46e5;     
  --accent: #facc15;      
  --border: #e5e7eb;     
}

/* =====================================================
   DARK MODE VARIABLES
   Activated when body has `.dark` class
===================================================== */
body.dark {
  --bg: #0f172a;
  --text: #e5e7eb;
  --card: #1e293b;
  --primary: #818cf8;
  --accent: #facc15;
  --border: #334155;
}


/* =====================================================
   CSS RESET
   Removes default browser spacing & ensures consistency
===================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =====================================================
   BASE BODY STYLES
===================================================== */
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}


/* =====================================================
   GLOBAL UI ELEMENTS
===================================================== */

.theme-toggle {
  margin-left: 1rem;
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.site-header,
.project.card,
.profile-card,
.site-footer {
  background: var(--card);
  color: var(--text);
}

.section-title,
.brand,
.project-info .link {
  color: var(--primary);
}

.bar {
  background: var(--border);
}

.bar span {
  background: var(--primary);
}


/* =====================================================
   CONTAINER
   Keeps content centered and within max width
===================================================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =======================HEADER START==============================*/

.site-header {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-size: 1.8rem;
  font-weight: bold;
  text-decoration: none;
}

.nav a {
  margin-left: 2rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: 0.3s;
}

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

.nav-toggle {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}
/* =======================HEADER END==============================*/

/* ======================= HERO SECTION START ==============================*/

.hero {
  display: flex;
  align-items: center;
  padding: 6rem 0;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.hero-left {
  flex: 1;
  min-width: 280px;
}

.hero-left h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.hero-left .accent {
  color: var(--accent);
}

.lead {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.hero-ctas .btn {
  padding: 0.8rem 1.5rem;
  margin-right: 1rem;
  background: var(--accent);
  color: #333;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  transition: 0.3s;
}

.hero-ctas .btn:hover {
  background: #eab308;
}

.hero-ctas .btn.alt {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}

.hero-ctas .btn.alt:hover {
  background: #fff;
  color: #333;
}

.hero-right {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 280px;
}
/* ======================= HERO SECTION END ==============================*/


/* ======================= PROFILE CARD START ==============================*/

.profile-card {
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.profile-card img {
  width: 150px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 4px solid var(--border);
}

.profile-body h3 {
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
}

.profile-body p {
  font-size: 0.9rem;
  color: #94a3b8;
}


.section {
  padding: 5rem 0;
}

.section .lead {
  text-align: center;
  margin-bottom: 3rem;
}


.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.project-info {
  padding: 1rem;
}

.project-info p {
  font-size: 0.9rem;
  color: #64748b;
}

/* ======================= PROFILE CARD END ==============================*/

/* ======================= ABOUT SECTION START ==============================*/


.about-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.about-text {
  flex: 1;
}

.about-avatar {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.about-avatar img {
  width: 250px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.word {
  display: inline-block;
  opacity: 0;
  transform: translateX(-20px);
  animation: wordReveal 0.6s ease forwards;
}

@keyframes wordReveal {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ======================= ABOUT SECTION END ==============================*/

/* ======================= SKILLS SECTION START ==============================*/

.skill-list {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem; 
}

.skill {
  position: relative;
  padding: 1.2rem 1.4rem;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.9)
  );

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    box-shadow 0.35s ease;
}

.skill.active {
  opacity: 1;
  transform: translateY(0);
}

.skill:hover {
  box-shadow:
    0 16px 45px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.skill h4 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 0.2rem;
}

.skill-note {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #64748b;
  margin-bottom: 0.7rem;
}


.bar {
  position: relative;
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    var(--border),
    #eef2f7
  );
  overflow: hidden;
}

.bar span {
  position: absolute;
  inset: 0;
  width: 0;

  background: linear-gradient(
    90deg,
    var(--primary),
    #6366f1
  );

  border-radius: 999px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: translateX(-100%);
}

.skill.active .bar span::after {
  animation: shine 1.6s ease forwards;
}

@keyframes shine {
  to {
    transform: translateX(100%);
  }
}

.skill:hover .bar span {
  filter: brightness(1.08);
}
   /* ================= SKILLS SECTION END =================*/


/* =====================================================
   DARK MODE – FULL POLISH
===================================================== */
body.dark .skill {
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.95),
    rgba(15, 23, 42, 0.95)
  );

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark .skill-note {
  color: #94a3b8;
}

body.dark .bar {
  background: linear-gradient(
    180deg,
    #1e293b,
    #0f172a
  );
}

/* ================== CONTACT SECTION START ============== */
.contact {
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.05),
    rgba(250, 204, 21, 0.08)
  );
}

body.dark .contact {
  background: linear-gradient(
    135deg,
    rgba(129, 140, 248, 0.08),
    rgba(250, 204, 21, 0.05)
  );
}

.contact-form {
  max-width: 650px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body.dark .contact-form {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.contact-form .row {
  display: flex;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: 0.25s;
}

.contact-form textarea {
  min-height: 140px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.contact-form button {
  width: 100%;
  margin-top: 1.2rem;
  padding: 0.9rem;
  border: none;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.contact-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

/* ================ CONTACT SECTION END ============== */


/* ================ FOOTER START ====================== */
.site-footer {
  text-align: center;
  padding: 2rem 0;
}



@media (max-width: 768px) {

  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .nav {
    display: none;
    flex-direction: column;
    background: var(--card);
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    padding: 1rem;
    border-radius: 6px;
  }

  .nav.show {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-form .row {
    flex-direction: column;
  }
}


.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.active {
  animation: revealAnim 0.8s ease forwards;
}




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


/* =====================================================
   BACK TO TOP BUTTON
===================================================== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#backToTop:hover {
  background: #4338ca;
}


@media (max-width: 768px) {
  .about-inner {
    flex-direction: column;
    text-align: center;
  }

  .about-avatar {
    justify-content: center;
  }
}


/* =====================================================
   PROJECTS – SMOOTH & CONFLICT-FREE ANIMATION FIX
   (NO EXISTING CODE REMOVED)
===================================================== */

.project.card {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1.2s ease,
    transform 1.6s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform, opacity;
}


.project.card.active {
  opacity: 1;
  transform: translateY(0);
}

.project.card.active:hover {
  transform: translateY(-8px);
}


@media (max-width: 768px) {
  .project.card {
    transition:
      opacity 0.8s ease,
      transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
