/* ===================== Design tokens ===================== */
:root {
  --brand: #4f46e5;
  --brand-2: #06b6d4;
  --brand-soft: rgba(79, 70, 229, 0.1);
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7ef;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 79, 70, 229;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-bs-theme="dark"] {
  --brand: #818cf8;
  --brand-2: #22d3ee;
  --brand-soft: rgba(129, 140, 248, 0.14);
  --bg: #0b1020;
  --bg-alt: #111833;
  --surface: #151d3b;
  --text: #e8ebf7;
  --muted: #9aa4c4;
  --border: #243058;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --bs-primary-rgb: 129, 140, 248;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
}

/* ===================== Base ===================== */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-family: var(--bs-body-font-family); overflow-x: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand); text-decoration: underline; }

.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
  box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), .3);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(var(--bs-primary-rgb), .38); }
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand);
}
.btn-link { color: var(--text); }
.btn-lg { border-radius: 12px; padding: .75rem 1.5rem; font-weight: 600; font-size: 1rem; }
.btn-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.btn-icon:hover { color: var(--brand); border-color: var(--brand); }

.text-gradient {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===================== Navbar ===================== */
#mainNav { padding: 1.1rem 0; transition: all .3s; }
#mainNav.scrolled {
  padding: .6rem 0; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border);
}
.navbar-brand { color: var(--text); display: flex; align-items: center; gap: .6rem; }
.navbar-brand:hover { text-decoration: none; color: var(--text); }
.brand-logo { border-radius: 11px; box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb), .3); transition: transform .3s; }
.navbar-brand:hover .brand-logo { transform: rotate(-6deg) scale(1.05); }
.brand-text { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: .95rem;
}
.nav-link { color: var(--muted); font-weight: 500; padding: .5rem .9rem !important; }
.nav-link:hover, .nav-link.active { color: var(--brand) !important; text-decoration: none; }
.navbar-toggler { color: var(--text); }
.navbar-toggler:focus { box-shadow: none; }
@media (max-width: 991.98px) {
  .navbar-collapse { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-top: .75rem; padding: .5rem; box-shadow: var(--shadow); }
}

/* ===================== Hero ===================== */
.hero {
  padding: 150px 0 90px; position: relative;
  background:
    radial-gradient(600px 400px at 85% 10%, var(--brand-soft), transparent 70%),
    radial-gradient(500px 300px at 5% 90%, rgba(6, 182, 212, .08), transparent 70%);
}
.badge-available {
  display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 99px;
  background: rgba(16, 185, 129, .12); color: #059669; font-weight: 600; font-size: .85rem;
}
[data-bs-theme="dark"] .badge-available { color: #34d399; }
.badge-available .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }

.hero-title { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.hero-role { font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 1rem 0 .5rem; }
.hero-tagline { color: var(--muted); font-size: 1.08rem; max-width: 560px; line-height: 1.7; }

.hero-social { display: flex; gap: .6rem; }
.hero-social a {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface); transition: all .2s;
}
.hero-social a:hover { color: #fff; background: var(--brand); border-color: var(--brand); text-decoration: none; transform: translateY(-3px); }

.hero-visual { position: relative; max-width: 380px; margin: 0 auto; aspect-ratio: 1; }
.avatar {
  position: absolute; inset: 8%; border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-size: clamp(3.5rem, 10vw, 5.5rem); font-weight: 800;
  box-shadow: 0 30px 60px rgba(var(--bs-primary-rgb), .3); overflow: hidden;
  animation: morph 10s ease-in-out infinite;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes morph {
  0%, 100% { border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%; }
  50% { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; }
}
.floating-chip {
  position: absolute; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: .55rem .95rem; border-radius: 12px; font-weight: 600; font-size: .9rem; display: flex; gap: .45rem; align-items: center;
  animation: float 5s ease-in-out infinite;
}
.floating-chip i { color: var(--brand); font-size: 1.1rem; }
.chip-1 { top: 6%; left: -4%; }
.chip-2 { bottom: 14%; right: -6%; animation-delay: -1.6s; }
.chip-3 { bottom: -2%; left: 8%; animation-delay: -3.2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 575.98px) { .chip-1 { left: 0; } .chip-2 { right: 0; } }

.stats .stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; text-align: center; height: 100%;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: .4rem; }

/* ===================== Sections ===================== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.eyebrow { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: .6rem; }
.section-title { font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.02em; line-height: 1.2; }
.section-sub { color: var(--muted); max-width: 560px; margin: .8rem auto 0; }
.lead-text p { color: var(--muted); font-size: 1.08rem; line-height: 1.8; }

.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.info-list li { display: flex; align-items: center; gap: .8rem; }
.info-list i {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
}

/* ===================== Skills ===================== */
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; height: 100%; transition: transform .25s, box-shadow .25s;
}
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.skill-card-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.skill-card-head i {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
}
.skill-card-head h3 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.skill { margin-bottom: 1rem; }
.skill:last-child { margin-bottom: 0; }
.skill-top { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; margin-bottom: .4rem; }
.skill-top span:last-child { color: var(--muted); font-weight: 500; }
.skill-bar { height: 7px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.skill-bar span {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}

/* ===================== Projects ===================== */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.filter-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: .5rem 1.1rem; border-radius: 99px; font-weight: 600; font-size: .9rem; transition: all .2s;
}
.filter-btn:hover { color: var(--brand); border-color: var(--brand); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-btn .count { opacity: .7; font-weight: 500; margin-left: .25rem; }

.project-col { transition: opacity .3s, transform .3s; }
.project-col.hide { display: none; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project-card:hover .project-thumb img { transform: scale(1.06); }
.project-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; gap: .3rem; text-align: center; padding: 1rem;
}
.project-placeholder i { font-size: 2.6rem; opacity: .95; }
.project-placeholder span { font-weight: 700; font-size: .95rem; opacity: .9; }
.ph-laravel     { background: linear-gradient(135deg, #f43f5e, #f97316); }
.ph-codeigniter { background: linear-gradient(135deg, #ea580c, #facc15); }
.ph-wordpress   { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.ph-template    { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.ph-frontend    { background: linear-gradient(135deg, #059669, #22d3ee); }
.ph-default     { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.project-cat {
  position: absolute; top: 12px; left: 12px; background: rgba(15, 23, 42, .7); color: #fff;
  font-size: .75rem; font-weight: 600; padding: .3rem .7rem; border-radius: 99px; backdrop-filter: blur(6px);
}
.project-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; background: var(--bg-alt); }
.project-status {
  position: absolute; top: 12px; right: 12px; font-size: .72rem; font-weight: 700; padding: .3rem .65rem;
  border-radius: 99px; display: inline-flex; align-items: center; gap: .35rem; backdrop-filter: blur(6px);
}
.project-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-live { background: rgba(236, 253, 245, .92); color: #047857; }
.st-done { background: rgba(239, 246, 255, .92); color: #1d4ed8; }
.st-wip  { background: rgba(255, 251, 235, .92); color: #b45309; }
.project-type { color: var(--brand) !important; font-size: .78rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
.project-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: .5rem; }
.project-body p { color: var(--muted); font-size: .94rem; line-height: 1.6; }
.tech-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1.1rem; }
.tech-list span { background: var(--brand-soft); color: var(--brand); font-size: .76rem; font-weight: 600; padding: .25rem .6rem; border-radius: 7px; }
.project-links { margin-top: auto; display: flex; gap: 1.2rem; }
.project-links a { font-weight: 600; font-size: .9rem; }

/* ===================== Services ===================== */
.service-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem 1.6rem; height: 100%; transition: all .25s; position: relative; overflow: hidden;
}
.service-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.service-card:hover::before { transform: scaleX(1); }
.service-card i {
  width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 1.2rem;
}
.service-card h3 { font-size: 1.12rem; font-weight: 700; }
.service-card p { color: var(--muted); font-size: .94rem; margin: 0; line-height: 1.65; }

/* ===================== Contact ===================== */
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: clamp(1.5rem, 4vw, 3.5rem); box-shadow: var(--shadow); }
.form-label { font-weight: 600; font-size: .9rem; }
.form-control { border-radius: 11px; padding: .75rem 1rem; background: var(--bg); border-color: var(--border); color: var(--text); }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--brand-soft); background: var(--bg); color: var(--text); }

/* ===================== Footer ===================== */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); color: var(--muted); }
.back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 14px;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.2rem;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .3s; z-index: 1000;
  box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), .35);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: #fff; text-decoration: none; }

/* ===================== Reveal animation ===================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
