/*ROOT VARIABLES*/
:root {
  --main-blue: #4c91ff;
  --glow-color: rgba(76, 145, 255, 0.6);
}

/*RESET & BASE*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
}

/*GLOBAL BACKGROUND & THEMES*/
body {
  background: linear-gradient(83deg, #0f2027, #203a43, #ffa17f);
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.5s ease, color 0.5s ease;
}

/* LIGHT MODE OVERRIDES */
body.light-mode {
  background: linear-gradient(83deg, #e0eafc, #cfdef3);
  color: #1a1a1a;
}
body.light-mode .section h3 { color: #333; }
body.light-mode .exp-main { color: #444; }
body.light-mode .exp-sub li { color: #666; }

/* In light mode, glass boxes need to be slightly darker/visible */
body.light-mode .glass-box {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

/*UNIVERSE CONTAINER*/
#universe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/*NAVBAR (DESKTOP DEFAULT) ||Goal: Links Centered | Socials+Toggle Right*/
.top-nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 70px;
  display: flex; 
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
  z-index: 100;
  background: rgba(15, 32, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease;
}

/* Light Mode Desktop Navbar */
body.light-mode .top-nav {
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 1. Links (Centered perfectly) */
.nav-menu {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  height: 100%;
  align-items: center;
}

.nav-link {
  font-size: 1.05rem;
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}
.nav-link:hover { color: #fff; }
.nav-link.active { color: var(--main-blue); }

/* Light mode text */
body.light-mode .nav-link { color: #555; }
body.light-mode .nav-link:hover { color: #000; }
body.light-mode .nav-link.active { color: var(--main-blue); }

.nav-indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: var(--main-blue);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -2px 10px var(--main-blue);
  transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 2. Right Side Group (Pinned Right via Absolute) */
.nav-right-group {
  position: absolute;
  right: 5vw;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-socials {
  display: flex;
  gap: 1.2rem;
}

.icon-btn img {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease;
}
.icon-btn:hover img { transform: scale(1.15); }

/*Theme Toggle */
.theme-toggle {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
  transition: background 0.3s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.25); }

/* Hamburger (Hidden Desktop) */
.hamburger { display: none; }


/*MAIN LAYOUT*/
main {
  margin-top: 64px;
  position: relative;
  z-index: 2;
}

.section {
  min-height: 100vh;
  padding: 6rem 6vw;
}

/* HOME / HERO*/
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: 4rem;
  transform: translateY(-20px);
}

.profile-frame {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(135deg, #3b82f6, #00aaff);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.profile-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hero-right h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.mobile-break { display: none; } 

.hero-right span {
  color: var(--main-blue);
  background: linear-gradient(to right, #4c91ff, #33d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin-top: 0.8rem;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.05);
}

/* GLASS BOX */
.glass-box {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: background 0.5s ease;
}

.hero .glass-box {
  max-width: 540px;
  padding: 2rem;
}
.hero .glass-box ul { list-style: none; }
.hero .glass-box li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem 0;
  font-size: 1.05rem;
}

/* EXPERIENCE SECTION */
.experience-box {
  padding: 3.5rem 4rem;
  width: 100%;
  max-width: 900px;
}

.experience-section .experience-tree {
  position: relative;
  padding-left: 2rem; 
  height: 100%; 
}

.experience-section .experience-tree::before {
  content: "";
  position: absolute;
  top: 10px;       
  bottom: 0px;    
  left: 9px;       
  width: 2px;
  background: rgba(76, 145, 255, 0.5);
}

.experience-section .exp-item {
  position: relative;
  margin-bottom: 4rem; 
  padding-left: 2rem;  
}
.experience-section .exp-item:last-child { margin-bottom: 0; }

.experience-section .exp-dot {
  position: absolute;
  left: -28px; 
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--main-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--main-blue);
  z-index: 2;
  border: 2px solid rgba(255,255,255,0.1);
}

.experience-section h3 {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
  color: #fff;
}
.experience-section .exp-role {
  font-weight: 600;
  color: var(--main-blue);
  margin-bottom: 0.2rem;
}
.experience-section .exp-date {
  font-size: 0.9rem;
  opacity: 0.7;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.experience-section .exp-points { list-style: none; padding: 0; }
.experience-section .exp-main {
  position: relative;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem; 
  color: #e0e0e0;
}
.experience-section .exp-main::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--main-blue);
  font-weight: 800;
}

.experience-section .exp-sub {
  list-style: none;
  margin-top: 0.6rem;
  padding-left: 0.5rem;
}
.experience-section .exp-sub li {
  position: relative;
  font-weight: 400;
  font-size: 0.95rem;
  color: #c0c0c0;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem; 
  line-height: 1.5;
}
.experience-section .exp-sub li::before {
  content: "●";
  position: absolute;
  left: 0;
  top: 7px;
  font-size: 0.6rem;
  color: var(--main-blue);
}

.section h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--main-blue);
  margin-bottom: 1rem;
  text-shadow: 0 0 20px rgba(76, 145, 255, 0.2);
}

/* PARTICLE STYLES (Stars & Snow) */

/* Common Styles for both Stars and Snow */
.star0, .star1, .star2, .star3 {
  position: absolute;
  border-radius: 50%;
  background-color: white; /* Default (Dark Mode) */
}

/* Sizes */
.star0 { width: 1px; height: 1px; opacity: 0.4; }
.star1 { width: 1.5px; height: 1.5px; opacity: 0.6; }
.star2 { width: 2px; height: 2px; opacity: 0.8; }
.star3 { 
  width: 2.5px; height: 2.5px; 
  opacity: 1; 
  box-shadow: 0 0 3px white; 
}

/* LIGHT MODE: Blue Snowflakes */
body.light-mode .star0,
body.light-mode .star1,
body.light-mode .star2,
body.light-mode .star3 {
  background-color: var(--main-blue);
}

body.light-mode .star0 { opacity: 0.4; }
body.light-mode .star1 { opacity: 0.6; }
body.light-mode .star2 { opacity: 0.8; }
body.light-mode .star3 {
  opacity: 1;
  box-shadow: none; 
}

/* PROJECTS SECTION */

.section-subtitle {
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
  opacity: 0.8;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
}

.project-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 350px; 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-top: 0; 
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(76, 145, 255, 0.15);
  border-color: rgba(76, 145, 255, 0.3);
}

.project-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
  color: #fff;
}
body.light-mode .project-card h3 { color: #222; }

.project-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 1.5rem;
  color: #e0e0e0;
}
body.light-mode .project-card p { color: #555; }

/* Tech Stack Pills */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.tech-stack span {
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  background: rgba(76, 145, 255, 0.15);
  color: var(--main-blue);
  border: 1px solid rgba(76, 145, 255, 0.2);
  font-weight: 500;
}

/* --- BUTTONS LAYOUT --- */
.card-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
  flex-wrap: wrap; 
}

.project-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem; 
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  backdrop-filter: blur(4px);
  flex: 1; 
  white-space: nowrap;
}

.btn-live {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.4);
  color: #a8e6cf; 
}
.btn-live:hover {
  background: rgba(46, 204, 113, 0.3);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

.btn-code {
  background: rgba(241, 196, 15, 0.15);
  border-color: rgba(241, 196, 15, 0.4);
  color: #f9e79f;
}
.btn-code:hover {
  background: rgba(241, 196, 15, 0.3);
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

.btn-dl {
  background: rgba(0, 210, 255, 0.15);
  border-color: rgba(0, 210, 255, 0.4);
  color: #aeeeff;
}
.btn-dl:hover {
  background: rgba(0, 210, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
  transform: translateY(-2px);
  color: #fff;
}

/* Light mode buttons */
body.light-mode .btn-live { color: #218c53; border-color: #218c53; }
body.light-mode .btn-code { color: #b7950b; border-color: #b7950b; }
body.light-mode .btn-dl   { color: #0984e3; border-color: #0984e3; }
body.light-mode .project-btn:hover { color: #fff; }


/* MOBILE RESPONSIVENESS (FINAL FIX) */
@media (max-width: 1024px) {
  
  /* 1. LAYOUT & OVERFLOW FIXES */
  .section {
    padding: 3rem 1.5rem; 
    overflow-x: hidden; 
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    transform: none; 
  }

  .profile-frame {
    width: 260px;
    height: 260px;
    margin: 0 auto; 
  }
  
  /* HERO TEXT FIX: Hi on line 1, Name on line 2 */
  .mobile-break { display: block; height: 0.5rem;} 

  .hero-right h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  /* LIST FIX: Left Align with neat bubbles */
  .hero .glass-box ul {
    align-items: flex-start; /* Align bullets to left */
    text-align: left; /* Align text to left */
  }

  /* 2. NAVBAR LAYOUT: Hamburger(Left) | Socials(Center) | Toggle(Right) */
  .top-nav {
    justify-content: space-between;
    height: 60px;
    padding: 0 1.2rem;
    background: rgba(15, 32, 39, 0.95);
  }

  /* Release the Nav Right Group from absolute position so it participates in Flex */
  .nav-right-group {
    position: static; /* No longer pinned right */
    display: contents; /* MAGIC FIX: This treats children as if they are direct children of top-nav */
  }
  
  /* Hamburger (Left) - Order 1 */
  .hamburger {
    display: block;
    cursor: pointer;
    z-index: 1002;
    order: 1; 
  }
  .bar {
    width: 24px;
    height: 2px; 
    margin: 6px auto;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  body.light-mode .bar { background-color: #333; }

  /* Social Icons (Center) - Order 2 */
  .nav-socials {
    order: 2; 
    margin: 0 auto; /* This centers it in the flex space */
  }

  /* Toggle (Right) - Order 3 */
  .theme-toggle {
    order: 3; 
  }

  /* 3. MOBILE MENU (Drawer) */
  .nav-menu {
    display: flex;
    position: fixed;
    left: -100%; /* Hidden Left */
    top: 0;
    flex-direction: column;
    background: rgba(11, 20, 26, 0.95); /* Semi Transparent */
    width: 75%; /* Glass box width */
    height: 100vh;
    padding-top: 100px; 
    justify-content: flex-start;
    align-items: center;
    transition: 0.4s ease; /* Smooth slide */
    gap: 2rem; 
    z-index: 1001;
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
  }

  /* Light Mode Menu BG */
  body.light-mode .nav-menu {
    background: rgba(245, 247, 250, 0.95);
  }

  .nav-menu.active { left: 0; }

  .nav-link {
    font-size: 1.3rem; 
    font-weight: 500;
  }
  .nav-indicator { display: none; }

  /* 4. CONTENT ADJUSTMENTS */
  .glass-box { padding: 1.5rem !important; }
  .experience-box { padding: 2rem 1rem !important; }
  .project-btn { width: 100%; justify-content: center; }
  .card-actions { flex-direction: column; }

  /* Hamburger Animation */
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}