/* ==========================================================================
   Portfolio — style.css
   Design system: dark (default) + light, gradient accent (blue -> purple).
   PRD §3, §6, §18, §19. Dibangun di atas Bootstrap 5.
   ========================================================================== */

/* ----------------------------- Design Tokens ---------------------------- */
:root {
    --accent-from: #3b82f6;
    --accent-to:   #8b5cf6;
    --accent:      linear-gradient(135deg, #3b82f6, #8b5cf6);
    --accent-solid:#6d5efc;

    /* Dark (default) */
    --bg:        #0b0e14;
    --bg-elev:   #141925;
    --bg-elev-2: #1b2233;
    --border:    rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text:      #e6e9f0;
    --text-muted:#9aa3b2;
    --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
    --sidebar-w: 288px;

    --radius:    16px;
    --radius-sm: 10px;
    --transition: 0.25s ease;
}

[data-theme="light"] {
    --bg:        #f5f7fb;
    --bg-elev:   #ffffff;
    --bg-elev-2: #eef1f7;
    --border:    rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text:      #1a1f2b;
    --text-muted:#5b6472;
    --shadow:    0 10px 30px rgba(15, 23, 42, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    padding-left: var(--sidebar-w); /* ruang untuk sidebar desktop */
}

@media (max-width: 991.98px) {
    body { padding-left: 0; padding-bottom: 64px; } /* bottom tab bar mobile */
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.section { padding: 72px 0; }
.container-custom { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.text-gradient {
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.text-muted-2 { color: var(--text-muted) !important; }
.section-title { font-weight: 700; letter-spacing: -0.02em; }
.section-sub { color: var(--text-muted); }

/* ------------------------------- Buttons -------------------------------- */
.btn-gradient {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn-gradient:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(109, 94, 252, .35); }
.btn-gradient:active { transform: translateY(0); }

.btn-outline-grad {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
    font-weight: 600;
    padding: 9px 22px;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-outline-grad:hover { border-color: var(--accent-solid); color: var(--text); transform: translateY(-2px); }

/* icon-button generic */
.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--bg-elev-2);
    color: var(--text);
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent-solid); color: var(--accent-solid); }

/* ----------------------------- Card base -------------------------------- */
.card-custom {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card-custom:hover { transform: translateY(-4px); border-color: var(--border-strong); }

/* ------------------------------ Sidebar --------------------------------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 28px 22px;
    z-index: 1040;
    transition: background var(--transition), border-color var(--transition);
}
.sidebar .profile-photo,
.drawer .profile-photo {
    width: 124px; height: 124px; border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 14px;
    border: 4px solid transparent;
    background: var(--accent) border-box;
}
.sidebar .profile-name { font-weight: 700; font-size: 1.15rem; }
.sidebar .profile-title { color: var(--text-muted); font-size: .85rem; }
.sidebar .socials { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sidebar .socials a {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text-muted);
    transition: var(--transition);
}
.sidebar .socials a:hover { color: var(--accent-solid); border-color: var(--accent-solid); transform: translateY(-2px); }

.sidebar nav { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 600;
    transition: var(--transition);
}
.sidebar nav a i { font-size: 1.1rem; }
.sidebar nav a:hover { background: var(--bg-elev-2); color: var(--text); }
.sidebar nav a.active { background: var(--accent); color: #fff; }

.sidebar .sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.theme-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: var(--radius-sm);
    background: var(--bg-elev-2); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; font-weight: 600; font-size: .9rem;
}
.theme-toggle:hover { border-color: var(--accent-solid); }
.theme-toggle .bi-moon-stars,
.theme-toggle .bi-sun { font-size: 1.1rem; }
[data-theme="light"] .theme-toggle .bi-sun { display: none; }
[data-theme="dark"]  .theme-toggle .bi-moon-stars,
:root              .theme-toggle .bi-moon-stars { display: inline-block; }
[data-theme="light"] .theme-toggle .show-on-light { display: inline; }
[data-theme="light"] .theme-toggle .show-on-dark  { display: none; }
[data-theme="dark"]  .theme-toggle .show-on-dark  { display: inline; }
[data-theme="dark"]  .theme-toggle .show-on-light { display: none; }

/* --------------------------- Top bar (mobile) --------------------------- */
.topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px; z-index: 1050;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    align-items: center; justify-content: space-between;
    padding: 0 16px;
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .logo img { width: 34px; height: 34px; }
.hamburger {
    background: var(--bg-elev-2); border: 1px solid var(--border);
    color: var(--text); width: 42px; height: 42px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

/* Drawer (offcanvas) full menu mobile */
.drawer {
    position: fixed; inset: 0; z-index: 1060;
    display: none;
}
.drawer.open { display: block; }
.drawer .overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.drawer .panel {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: min(86vw, 340px);
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 28px 22px;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s ease;
}
.drawer.open .panel { transform: translateX(0); }
.drawer .drawer-close { position: absolute; top: 18px; right: 18px; }
.drawer nav { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; }
.drawer nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 600;
}
.drawer nav a.active { background: var(--accent); color: #fff; }
.drawer .drawer-footer { margin-top: auto; color: var(--text-muted); font-size: .8rem; }
.drawer .socials { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.drawer .socials a {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text-muted);
}

/* ------------------------- Bottom tab bar (mobile) ---------------------- */
.bottom-tab {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px; z-index: 1050;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-tab a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-muted); font-size: .72rem; font-weight: 600;
    flex: 1;
}
.bottom-tab a i { font-size: 1.25rem; }
.bottom-tab a.active { color: var(--accent-solid); }

/* -------------------------------- Hero ---------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.hero .lead { color: var(--text-muted); font-size: 1.05rem; margin: 18px 0 26px; max-width: 520px; }
.hero-illustration { width: 100%; max-width: 440px; margin: 0 auto; filter: drop-shadow(0 20px 40px rgba(109,94,252,.25)); }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-elev); border: 1px solid var(--border);
    padding: 6px 14px; border-radius: 999px; font-size: .82rem; color: var(--text-muted);
    margin-bottom: 18px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }

/* ------------------------------- About ---------------------------------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.info-card { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.info-item .label { color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.info-item .value { font-weight: 600; margin-top: 4px; word-break: break-word; }

/* ------------------------------- Skills --------------------------------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.skill-item {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px; text-align: center;
    transition: var(--transition);
}
.skill-item:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.skill-icon {
    width: 52px; height: 52px; margin: 0 auto 12px;
    border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #fff;
}
.skill-name { font-weight: 600; }

/* --------------------------- Popular projects -------------------------- */
.project-card { display: block; height: 100%; overflow: hidden; }
.project-card .thumb {
    aspect-ratio: 16/10; width: 100%; object-fit: cover;
    transition: transform .4s ease;
}

/* All Projects listing (#projectsGrid) — SATU card utuh, tinggi mengikuti isi */
#projectsGrid { align-items: start; }
#projectsGrid .project-item > .project-card {
    display: flex;
    flex-direction: column;
}
#projectsGrid .project-card .thumb {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    flex: 0 0 auto;
}
#projectsGrid .project-card .body {
    display: flex;
    flex-direction: column;
}
#projectsGrid .project-card .desc {
    -webkit-line-clamp: 3;
}
.project-card:hover .thumb { transform: scale(1.06); }
.project-card .body { padding: 18px; }
.project-card .cat { color: var(--text-muted); font-size: .8rem; }
.project-card .title { font-weight: 700; margin: 4px 0 8px; }
.project-card .desc { color: var(--text-muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card .meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* Swipeable carousel (mobile) */
.popular-carousel { display: none; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.popular-carousel .slide { scroll-snap-align: start; flex: 0 0 82%; }
.carousel-dots { display: none; justify-content: center; gap: 8px; margin-top: 16px; }
.carousel-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); cursor: pointer; transition: var(--transition); }
.carousel-dots .dot.active { background: var(--accent-solid); width: 22px; border-radius: 999px; }

/* ------------------------------- Status badge --------------------------- */
.status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    font-size: .76rem; font-weight: 600;
    color: var(--badge-color);
    background: color-mix(in srgb, var(--badge-color) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--badge-color) 45%, transparent);
}
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--badge-color); }

/* ------------------------------- Contact -------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.contact-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px;
    transition: var(--transition);
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--accent-solid); }
.contact-card .ic { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; background: var(--accent); color: #fff; flex: 0 0 auto; }
.contact-card .label { color: var(--text-muted); font-size: .76rem; }
.contact-card .value { font-weight: 600; font-size: .92rem; word-break: break-word; }
.contact-illustration { width: 100%; max-width: 420px; margin: 0 auto; }

/* ------------------------------- Footer --------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0 28px; background: var(--bg-elev); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer a { color: var(--text-muted); transition: color var(--transition); }
.footer a:hover { color: var(--accent-solid); }
.footer .copyright { margin-top: 28px; color: var(--text-muted); font-size: .82rem; text-align: center; border-top: 1px solid var(--border); padding-top: 18px; }

/* ------------------------- Projects listing ---------------------------- */
.breadcrumb-custom { color: var(--text-muted); font-size: .9rem; }
.breadcrumb-custom a:hover { color: var(--accent-solid); }

.filter-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 30px; }
.filter-pill {
    padding: 8px 18px; border-radius: 999px;
    background: var(--bg-elev); border: 1px solid var(--border);
    color: var(--text-muted); font-weight: 600; font-size: .88rem;
    cursor: pointer; transition: var(--transition);
}
.filter-pill:hover { border-color: var(--accent-solid); color: var(--text); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project-links { display: flex; gap: 10px; margin-top: 12px; }
.project-links a { color: var(--text-muted); font-size: .95rem; transition: color var(--transition); }
.project-links a:hover { color: var(--accent-solid); }

/* Pagination */
.pagination-custom { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination-custom a, .pagination-custom span {
    min-width: 40px; height: 40px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-elev); color: var(--text-muted); font-weight: 600; transition: var(--transition);
}
.pagination-custom a:hover { border-color: var(--accent-solid); color: var(--text); }
.pagination-custom a.active { background: var(--accent); color: #fff; border-color: transparent; }
.pagination-custom span.disabled { opacity: .4; pointer-events: none; }

/* ------------------------- Project detail ------------------------------ */
.detail-back { color: var(--text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.detail-back:hover { color: var(--accent-solid); }
.detail-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 12px 0; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tag-chip { padding: 4px 12px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); }

.detail-gallery-main { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev); }
.detail-gallery-main img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: opacity .25s ease; }
.gallery-thumbs { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.gallery-thumbs button {
    width: 88px; height: 60px; border-radius: 10px; overflow: hidden;
    border: 2px solid var(--border); background: none; padding: 0; cursor: pointer; transition: var(--transition);
}
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button.active { border-color: var(--accent-solid); }

.feature-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.feature-list li { display: flex; align-items: flex-start; gap: 10px; }
.feature-list li i { color: #22c55e; font-size: 1.1rem; margin-top: 2px; }

.info-project { display: grid; gap: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.info-row .k { color: var(--text-muted); font-size: .85rem; }
.info-row .v { font-weight: 600; text-align: right; }

.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* --------------------------- Back to top ------------------------------- */
.back-to-top {
    position: fixed; right: 22px; bottom: 84px; z-index: 1045;
    width: 46px; height: 46px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; border: none; cursor: pointer;
    box-shadow: var(--shadow); transition: var(--transition);
}
.back-to-top.show { display: inline-flex; }
.back-to-top:hover { transform: translateY(-3px); }

@media (max-width: 991.98px) {
    .back-to-top { bottom: 78px; }
}

/* ---------------------------- Animations ------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------------------------- Responsive ------------------------------- */
@media (max-width: 991.98px) {
    .topbar { display: flex; }
    .sidebar { display: none; }
    .bottom-tab { display: flex; }
    .section { padding: 56px 0; }
    .container-custom { padding: 0 18px; }
    .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .hero-illustration, .contact-illustration { order: -1; max-width: 320px; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
    .popular-desktop { display: none; }
    .popular-carousel { display: flex; }
    .carousel-dots { display: flex; }
}

@media (max-width: 575.98px) {
    .projects-grid { grid-template-columns: 1fr; }
    .info-card { grid-template-columns: 1fr; }
    .info-project { grid-template-columns: 1fr; }
}
