/* --- Base Styles and Font Imports (already included in HTML head) --- */
body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: linear-gradient(135deg, #101624 0%, #0e1120 100%);
  color: #f3f4f6;
  min-height: 100vh;
  transition: background 0.6s;
}

a {
  color: #13bdf9;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover,
a:focus {
  color: #45ebfa;
}

h1, h2, h3 {
  font-family: "Orbitron", "Poppins", Arial, sans-serif;
  letter-spacing: 1.5px;
}

/* --- Preloader / Loading Screen --- */
.preloader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(16,32,48,0.96);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s;
}

.preloader-title {
  font-family: "Orbitron", Arial, sans-serif;
  font-size: 2.6rem;
  color: #13bdf9;
  text-shadow: 0 0 12px #13bdf9, 0 0 40px #090e29;
  margin: 0;
}
.preloader-tagline {
  color: #70e2ff;
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: .75rem;
  text-shadow: 0 0 6px #2ceadb;
}

/* --- Hide Preloader & Reveal Content --- */
#main-content {
  opacity: 0;
  transition: opacity 0.7s;
}
body.loaded #preloader {
  opacity: 0;
  pointer-events: none;
}
body.loaded #main-content {
  display: block !important;
  opacity: 1;
  transition-delay: 0.3s;
}

/* --- Navbar Styles --- */
.navbar {
  background: rgba(14,24,40, 0.9);
  display: flex;
  justify-content: center;
  box-shadow: 0 4px 32px #10162830;
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 999;
}

.navbar ul {
  display: flex;
  gap: 1.3rem;
  list-style: none;
  margin: 0; padding: 0;
}

.nav-link {
  font-family: "Orbitron";
  font-size: 1.1rem;
  color: #a5b5be;
  padding: 0.5rem 1.2rem;
  position: relative;
  border-radius: 16px;
  transition: background 0.3s, color 0.3s;
}

.nav-link.active,
.nav-link:hover {
  color: #fff;
  background: rgba(30,224,235,0.08);
}
.nav-link.active:after {
  content: "";
  display: block;
  height: 4px;
  border-radius: 3px 3px 12px 12px;
  width: 75%;
  margin: 0.25rem auto 0;
  background: linear-gradient(90deg, #13bdf9 50%, #46ecff 100%);
  box-shadow: 0 0 12px #00e8ff66;
}

/* --- Section Glassmorphism --- */
.section.glass-section {
  margin: 2rem auto;
  padding: 2.5rem 1.5rem 2rem 1.5rem;
  max-width: 930px;
  background: rgba(16, 24, 32, 0.77);
  border-radius: 22px;
  box-shadow: 0 6px 44px #4ff4ff18, 0 1.5px 12px #16caff30;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(19, 163, 249, 0.25);
}

/* --- Profile Section --- */
.profile-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
#profile-photo {
  width: 148px;
  height: 148px;
  border-radius: 60%;
  border: 3px solid #13bdf9aa;
  box-shadow: 0 0 32px #19e0e699;
  background: #222b44;
  object-fit: cover;
}
.profile-text {
  max-width: 420px;
}

/* --- Project Cards --- */
.projects-grid, .skills-grid, .certifications-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  align-items: stretch;
}

.project-card,
.skill-card,
.cert-card {
  background: rgba(16,24,32,0.77);
  border-radius: 18px;
  border: 2.5px solid #13bdf9;
  box-shadow: 0 4px 32px #12c4ff19, 0 1px 32px #13bdf921;
  transition: box-shadow 0.3s, border-color 0.3s;
  min-width: 280px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.3rem;
  padding: 1.2rem;
  color: #fff;
  position: relative;
}
.project-card:hover,
.skill-card:hover,
.cert-card:hover {
  border-color: #45ebfa;
  box-shadow: 0 8px 40px #45ebfa33;
}

.project-card img,
.project-card video {
  width: 98%;
  max-width: 320px;
  min-height: 160px;
  max-height: 180px;
  object-fit: cover;
  border-radius: 13px;
  margin-bottom: 1rem;
}

/* Project Info */
.project-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
  color: #50e9ff;
  text-shadow: 0 0 8px #10defc23;
}
.project-card p {
  font-size: 1rem;
  margin: 0 0 0.7rem;
}
.project-card .tech-list {
  margin: 0.3rem 0 0.4rem 0;
  font-size: .95rem;
  color: #2cf2ff;
}
.project-card a {
  margin-top: 0.7rem;
  background: linear-gradient(90deg, #13bdf9 60%, #45ebfa 100%);
  color: #0e243c;
  padding: 0.35rem 1.1rem;
  border-radius: 15px;
  font-weight: 600;
  font-family: "Orbitron";
  transition: background 0.2s, color 0.2s;
  box-shadow: 0 2px 11px #13bdf924;
}
.project-card a:hover {
  background: linear-gradient(90deg, #46ecff 60%, #13bdf9 100%);
  color: #000;
}

/* --- Skill Cards --- */
.skill-card {
  min-width: 180px; max-width: 230px;
}
.skill-card img, .skill-card .skill-icon {
  width: 56px; height: 56px;
  margin-bottom: .7rem;
}
.skill-card h4 {
  color: #50e9ff;
  font-family: "Orbitron";
  font-size: 1.1rem;
  margin: 0.1rem 0 0.4rem 0;
}
.skill-card .skill-level {
  font-size: .93rem;
  margin-bottom: .3rem;
  color: #30e4db;
}
.skill-card p {
  font-size: 0.93rem;
  color: #d9fcfb;
}

/* --- Certification Cards --- */
.cert-card img {
  width: 90%;
  margin-bottom: .7rem;
  border-radius: 8px;
}
.cert-card h4 {
  font-family: "Orbitron";
  color: #13bdf9;
  margin: 0 0 .3rem 0;
}
.cert-card .cert-issuer {
  color: #65e6f9;
  font-size: 1rem;
}
.cert-card .cert-date {
  font-size: .93rem;
  color: #6fe6e9;
}
.cert-card p { color: #e2f5fa; font-size: .95rem; }

/* --- Upgrade Tracker Panel --- */
.tracker-panel {
  position: fixed;
  right: 2vw;
  bottom: 2vh;
  width: 265px;
  max-width: 90vw;
  background: rgba(14,30,36,0.92);
  border: 2px solid #26f6ff63;
  border-radius: 18px;
  box-shadow: 0 6px 36px #10def921;
  color: #b2faff;
  padding: 1rem 1rem 0.6rem 1.1rem;
  font-size: 0.96rem;
  z-index: 2024;
  transition: opacity 0.3s;
}
.tracker-panel h3 {
  margin: 0 0 .3rem 0;
  color: #13bdf9;
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.tracker-panel ul {
  margin: .2rem 0 0 0;
  padding: 0 0 0 1rem;
}
.tracker-panel li {
  margin-bottom: .28rem;
  color: #39e9ef;
}

/* --- Transitions, Animation, and Responsive --- */
.section {
  opacity: 0;
  transform: translateY(64px);
  transition: all .7s cubic-bezier(.67,-0.15,.39,1.1);
}
.section.visible {
  opacity: 1;
  transform: none;
}
/* Navbar active transition (for script) */
.nav-link {
  transition: background 0.23s, color 0.23s;
}
.nav-link.active {
  transition: background 0.29s, color 0.29s;
}

/* Uniform height across cards (flex stretch) */
.projects-grid, .skills-grid, .certifications-grid {
  align-items: stretch;
}

/* --- Responsive Styles --- */
@media (max-width: 1000px) {
  .section.glass-section { max-width: 98vw; }
  .projects-grid, .skills-grid, .certifications-grid { gap: 1.1rem; }
}
@media (max-width: 700px) {
  .profile-container { flex-direction: column; gap: 1rem; }
  .project-card, .skill-card, .cert-card { min-width: 96vw; max-width: 98vw; }
  .tracker-panel {
    right: .7vw; bottom: .7vh; width: 94vw; font-size: 1rem;
  }
}

@media (max-width: 500px) {
  .section.glass-section { padding: 1.2rem 0.4rem 1.5rem 0.4rem; }
  .projects-grid, .skills-grid, .certifications-grid { flex-direction: column; align-items: center; gap: 0.85rem; }
  #profile-photo { width: 95px; height: 95px; }
}

/* === MOBILE NAV MENU === */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1000px;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #a5b5be;
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 5%;
    background: rgba(14,24,40,0.95);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  }
  .nav-menu.active {
    display: flex;
    gap: 0.8rem;
  }
  .nav-menu li {
    text-align: right;
  }
}

/* === RESPONSIVE GRID FIXES === */
.projects-grid, .skills-grid, .certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 1.5rem;
}
