/* ===================== */
/* THEME VARIABLES       */
/* ===================== */
:root {
  --primary: #2ecc71;       /* emerald green */
  --primary-600: #27b463;
  --primary-400: #5cd98f;
  --bg: #ffffff;
  --text: #1d1d1f;
  --muted: #6c757d;
  --card-bg: #ffffff;
  --glass: rgba(255,255,255,0.6);
  --shadow: rgba(0,0,0,0.06);
}

/* Dark mode variables */
body.dark {
  --bg: #071019;
  --text: #e9f6f2;
  --muted: #9aa6bb;
  --primary: #1abc9c;
  --primary-600: #159f84;
  --primary-400: #3dd6b0;
  --card-bg: rgba(10,18,25,0.6);
  --glass: rgba(255,255,255,0.04);
  --shadow: rgba(0,0,0,0.5);
}

/* ===================== */
/* BASE STYLES           */
/* ===================== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(180deg, var(--bg), #f7fbfa 140%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color .2s ease;
}
a:hover {
  color: var(--primary-600);
}

/* ===================== */
/* PRELOADER             */
/* ===================== */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader-inner { display: flex; gap: 8px; align-items: center; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary);
  animation: pop 0.9s infinite;
}
.dot-2 { animation-delay: 0.15s; }
.dot-3 { animation-delay: 0.3s; }
@keyframes pop {
  0% { transform: translateY(0); opacity: 0.25; }
  50% { transform: translateY(-10px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.25; }
}

/* ===================== */
/* NAVBAR                */
/* ===================== */
.navbar {
  background: transparent;
  padding: 0.6rem 0;
  transition: background .3s ease, color .3s ease;
}
.navbar .brand-avatar {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 18px var(--shadow);
}
.navbar .brand-name { font-weight: 700; color: var(--text); }
.nav-link { color: var(--muted) !important; transition: color .2s; }
.nav-link:hover { color: var(--primary) !important; }
.navbar .btn-outline-secondary { border-color: rgba(0,0,0,0.08); color: var(--muted); }

/* ===================== */
/* HERO SECTION          */
/* ===================== */
.bg-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  position: relative; overflow: hidden;
  color: #fff;
}
.bg-hero .avatar-lg { width: 220px; height: 220px; object-fit: cover; }
.bg-hero .display-5 { font-weight: 700; }
.wave {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 60px; fill: rgba(255,255,255,0.12);
}

/* ===================== */
/* CARDS                 */
/* ===================== */
.card {
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 10px 30px var(--shadow);
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
.project-card .card-body {
  transition: transform .25s ease, box-shadow .25s ease;
}
.project-card:hover .card-body {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15,23,42,0.06);
}

/* ===================== */
/* PROFILE IMAGES        */
/* ===================== */
.profile-lg {
  width: 260px; height: 260px;
  object-fit: cover;
  border-radius: 16px;
}
.avatar-lg { border: 6px solid rgba(255,255,255,0.12); }

/* ===================== */
/* SKILL BARS            */
/* ===================== */
.skill {
  background: transparent;
  padding: 10px;
  border-radius: 8px;
}
.skill-bar {
  height: 12px;
  background: rgba(13,110,253,0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.skill-bar .fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-400));
  transition: width 900ms cubic-bezier(.2,.9,.3,1);
}
.skill .float-end {
  font-weight: 600;
  color: var(--muted);
}

/* ===================== */
/* BUTTONS               */
/* ===================== */
.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border: 0;
  color: #fff;
  transition: background .25s;
}
.btn-primary:hover { background: linear-gradient(180deg, var(--primary-600), var(--primary)); }

.btn-outline-secondary {
  border-color: rgba(0,0,0,0.06);
  color: var(--muted);
}
body.dark .btn-outline-secondary {
  border-color: rgba(255,255,255,0.08);
  color: var(--muted);
}

/* ===================== */
/* BACK TO TOP BUTTON    */
/* ===================== */
#backToTop {
  position: fixed;
  right: 20px; bottom: 24px;
  display: none;
  z-index: 9999;
  border-radius: 50%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  transition: background .3s ease;
}
#backToTop:hover { background: var(--primary-600); }

/* ===================== */
/* RESPONSIVE            */
/* ===================== */
@media (max-width: 767px) {
  .profile-lg { display: none; }
  .bg-hero { padding-top: 3rem; padding-bottom: 3rem; }
}

/* ===================== */
/* ACCESSIBILITY         */
/* ===================== */
button:focus, a:focus {
  outline: 3px solid rgba(34,197,94,0.18);
  outline-offset: 2px;
}

.text-muted a { color: var(--muted); }
