/* ===== CSS Variables ===== */
:root {
  --bg-dark: #0f0f0f;
  --bg-card: #202020;
  --accent-primary: #5dd62c;
  --accent-secondary: #337418;
  --text-main: #f8f8f8;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ===== Preloader ===== */
#preloader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: var(--bg-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 50px; height: 50px;
  border: 5px solid var(--bg-card);
  border-top: 5px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px var(--accent-secondary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* ===== Navigation ===== */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 15, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(93, 214, 44, 0.1);
  transition: var(--transition-smooth);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4%;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent-primary);
  text-decoration: none;
  letter-spacing: -1px;
  transition: var(--transition-smooth);
}

.logo:hover {
  text-shadow: 0 0 10px var(--accent-secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0; padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 0; height: 2px;
  background: var(--accent-primary);
  transition: var(--transition-smooth);
}

.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--accent-primary); }

.hire-btn {
  background: var(--accent-primary);
  color: var(--bg-dark);
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(93, 214, 44, 0.3);
}

.hire-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(93, 214, 44, 0.5);
  background: #fff;
}

/* ===== Hamburger Menu ===== */
#menu-toggle { display: none; }

.hamburger {
  display: none;
  cursor: pointer;
  width: 30px; height: 20px;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1002;
}

.hamburger .line {
  display: block;
  width: 100%; height: 3px;
  background-color: #fff;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.hamburger .line:nth-child(2) {
  width: 80%;
  align-self: flex-end;
}

#menu-toggle:checked ~ .hamburger .line:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
  background-color: var(--accent-primary);
}
#menu-toggle:checked ~ .hamburger .line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
#menu-toggle:checked ~ .hamburger .line:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
  background-color: var(--accent-primary);
}

/* ===== Mobile Menu ===== */
@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .hire-btn { display: none; }

  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: 280px;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding-top: 80px;
    border-left: 1px solid rgba(93, 214, 44, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    transition: 0.5s cubic-bezier(0.77, 0.2, 0.05, 1.0);
  }

  #menu-toggle:checked ~ .nav-links {
    right: 0;
  }
}

/* ===== Shared Section Layout ===== */
.section {
  padding: 80px 5%;
}

.container {
  max-width: 1150px;
  margin: 0 auto;
}

.section-title {
  font-size: 48px;
  text-align: center;
  color: var(--accent-primary);
  margin-bottom: 15px;
}

.section-subtitle {
  text-align: center;
  color: #888;
  font-size: 20px;
  margin-bottom: 50px;
}

/* ===== About Section ===== */
.about-section {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 5% 80px;
  background: radial-gradient(circle at 10% 20%, rgba(93, 214, 44, 0.05) 0%, transparent 50%);
}

.about-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  max-width: 1200px;
  width: 100%;
}

.about-content h1 {
  font-size: 50px;
  margin-bottom: 10px;
  line-height: 1.2;
}

.about-content h1 span {
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(93, 214, 44, 0.3);
}

.roles {
  font-size: 30px;
  color: var(--accent-primary);
  font-weight: 600;
  height: 40px;
  margin-bottom: 20px;
}

.about-content p {
  font-size: 1.1rem;
  color: #ccc;
  max-width: 600px;
  line-height: 1.8;
  margin-bottom: 30px;
}

.about-buttons {
  display: flex;
  align-items: center;
  gap: 30px;
}

.btn {
  background: var(--accent-primary);
  color: var(--bg-dark);
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(93, 214, 44, 0.3);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(93, 214, 44, 0.5);
  background: #fff;
}

.social-links {
  display: flex;
  gap: 30px;
}

.social-links a {
  font-size: 30px;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.social-links a:hover {
  color: var(--accent-primary);
  transform: translateY(-5px);
}

.about-image {
  position: relative;
  width: 450px; height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.about-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  border: 4px solid var(--accent-primary);
  animation: morph 8s ease-in-out infinite, float 4s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(93, 214, 44, 0.2);
}

@keyframes morph {
  0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50%  { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

@media (max-width: 968px) {
  .about-section { padding: 100px 5% 60px; }
  .about-container { flex-direction: column-reverse; text-align: center; gap: 40px; }
  .about-content { display: flex; flex-direction: column; align-items: center; }
  .about-buttons { flex-direction: column; gap: 20px; }
  .about-image { width: 320px; height: 300px; }
}

@media (max-width: 480px) {
  .about-content h1 { font-size: 32px; }
  .roles { font-size: 22px; height: auto; }
  .about-image { width: 260px; height: 240px; }
  .about-content p { font-size: 1rem; }
  .social-links { gap: 20px; }
}

/* ===== Services Section ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  padding: 40px 30px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at top right, rgba(93, 214, 44, 0.15), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.service-card:hover::before { opacity: 1; }

.service-icon {
  font-size: 2.5rem;
  color: var(--accent-primary);
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(93, 214, 44, 0.3));
}

.service-card h3 { font-size: 1.4rem; margin-bottom: 15px; }
.service-card p { color: #aaa; line-height: 1.6; font-size: 0.95rem; margin: 0; }

@media (max-width: 768px) {
  .section-title { font-size: 32px; }
  .section-subtitle { font-size: 16px; padding: 0 10px; }
  .services-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
  .service-card { padding: 30px 25px; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 28px; }
}

/* ===== Skills Section ===== */
#skills {
  background: #0a0a0a;
  padding: 60px 5%;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 30px auto;
}

.skill-card {
  background: #151515;
  height: 145px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 1px solid rgba(93, 214, 44, 0.1);
  border-bottom: 3px solid var(--accent-primary);
  transition: var(--transition-smooth);
  overflow: hidden;
}

.status-dot {
  position: absolute;
  top: 12px; right: 12px;
  width: 6px; height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-primary);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.2); }
}

.skill-card i,
.skill-card .cpp-icon {
  font-size: 2.8rem;
  color: #fff;
  margin-bottom: 10px;
  opacity: 0.8;
}

.skill-card p {
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.5px;
}

.skill-card:hover {
  background: #1f1f1f;
  transform: translateY(-8px);
  border-color: var(--brand-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(93, 214, 44, 0.1);
}

.skill-card:hover i,
.skill-card:hover .cpp-icon {
  color: var(--brand-color);
  opacity: 1;
  filter: drop-shadow(0 0 10px var(--brand-color));
}

.skill-card:hover p { color: #fff; }

@media (max-width: 768px) {
  .skills-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
  .skill-card { height: 130px; }
  .skill-card i, .skill-card .cpp-icon { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .skill-card { height: 120px; }
  .skill-card p { font-size: 0.75rem; }
}

/* ===== Education Section ===== */
.bento-education {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 30px auto;
}

.bento-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.bento-card.featured {
  grid-column: span 2;
  background: linear-gradient(145deg, rgba(93, 214, 44, 0.05), rgba(0, 0, 0, 0.2));
  border-color: rgba(93, 214, 44, 0.2);
}

.bento-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.bento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.status-badge {
  background: var(--accent-primary);
  color: #000;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.edu-year {
  color: #555;
  font-size: 0.85rem;
}

.bento-card h3 {
  font-size: 24px;
  color: #fff;
  margin: 15px 0 5px;
}

.bento-card .institution {
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 10px;
}

.grade { color: #888; }

.grade span {
  color: #fff;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.bento-icon,
.bento-icon-sm {
  position: absolute;
  right: -10px; bottom: -10px;
  font-size: 5rem;
  color: rgba(93, 214, 44, 0.05);
  transform: rotate(-15deg);
  transition: var(--transition-smooth);
}

.bento-card:hover .bento-icon,
.bento-card:hover .bento-icon-sm {
  color: rgba(93, 214, 44, 0.1);
  transform: rotate(0deg) scale(1.1);
}

.skills-tag {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.skills-tag span { color: #888; font-size: 0.9rem; }

@media (max-width: 768px) {
  .bento-education { grid-template-columns: 1fr; }
  .bento-card.featured { grid-column: span 1; }
  .bento-card h3 { font-size: 20px; }
  .bento-icon { font-size: 4rem; }
}

@media (max-width: 480px) {
  .bento-card h3 { font-size: 18px; }
  .bento-card .institution { font-size: 0.9rem; }
  .status-badge { font-size: 0.65rem; }
}

/* ===== Projects Section ===== */
.projects-section {
  padding: 60px 5%;
  background-color: var(--bg-dark);
}

.filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 40px 0;
}

.filter-btn {
  background: #161616;
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
}

.filter-btn:hover {
  color: #fff;
  border-color: rgba(93, 214, 44, 0.5);
  transform: translateY(-3px);
  background: #1a1a1a;
}

.filter-btn.active {
  background: var(--accent-primary);
  color: #000;
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(93, 214, 44, 0.4);
  font-weight: 700;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  max-width: 1400px;
  margin: 50px auto 0;
}

.project-card {
  position: relative;
  width: 350px;
  aspect-ratio: 1 / 0.8;
  background: #111;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.project-image { width: 100%; height: 100%; }

.project-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.6);
  transition: all 0.5s ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(93, 214, 44, 0.2) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease-out;
  backdrop-filter: blur(3px);
}

.project-card:hover {
  transform: translateY(-15px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.project-card:hover .project-overlay {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover img {
  filter: brightness(1);
  transform: scale(1.1);
}

.project-overlay h3 {
  color: #fff;
  font-size: 28px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-overlay p {
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-sm {
  padding: 10px 20px;
  background: var(--accent-primary);
  color: #000;
  text-decoration: none;
  font-weight: 700;
  border-radius: 50px;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.btn-sm:hover {
  transform: scale(1.1);
  background: #fff;
}

@media (max-width: 768px) {
  .project-card { width: 100%; max-width: 400px; }
  .project-overlay h3 { font-size: 24px; }
}

@media (max-width: 480px) {
  .filter-container { gap: 8px; }
  .filter-btn { padding: 8px 14px; font-size: 0.75rem; }
  .project-card { aspect-ratio: 1 / 1; }
}

/* ===== Certifications Section ===== */
.certifications-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  margin-top: 50px;
}

.cert-card {
  background: var(--bg-card);
  width: 450px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.cert-image {
  width: 100%;
  aspect-ratio: 1 / 0.6;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  border-bottom: 2px solid var(--accent-primary);
}

.cert-image img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.cert-content {
  padding: 20px;
  text-align: center;
}

.cert-content h3 { font-size: 1.2rem; margin-bottom: 8px; }
.cert-content p { color: #888; font-size: 0.9rem; margin-bottom: 15px; }
.cert-content strong { color: var(--accent-primary); }

.cert-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 30px rgba(93, 214, 44, 0.1);
}

.cert-card:hover img { transform: scale(1.05); }

@media (max-width: 768px) {
  .cert-card { width: 100%; max-width: 450px; }
  .cert-content h3 { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .cert-image { padding: 10px; }
  .cert-content { padding: 15px; }
}

/* ===== Contact Section ===== */
#contact {
  padding: 80px 5%;
  background: var(--bg-dark);
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-message { flex: 1; min-width: 320px; }

.contact-message h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #fff;
  margin-bottom: 20px;
  line-height: 1.1;
}

.contact-message h2 span {
  color: var(--accent-primary);
  display: block;
}

.contact-message p {
  color: #aaa;
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 500px;
}

.contact-info {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #161616;
  padding: 25px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.info-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
  background: #1d1d1d;
}

.info-icon {
  width: 55px; height: 55px;
  background: rgba(93, 214, 44, 0.1);
  color: var(--accent-primary);
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-item p {
  color: #fff;
  font-size: 1rem;
  word-break: break-all;
  margin: 0;
}

/* ===== Footer ===== */
.footer {
  background: #0a0a0a;
  padding: 40px 5%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.footer-text p { font-size: 0.95rem; color: #888; margin: 0; }

.footer-social { display: flex; gap: 30px; }

.footer-social a {
  color: #666;
  font-size: 1.3rem;
  transition: var(--transition-smooth);
}

.footer-social a:hover {
  color: var(--accent-primary);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .footer-container { flex-direction: column; text-align: center; }
  .footer-social { justify-content: center; order: -1; }
}
