/* ============================================================
   1.  VARIABLES (Light & Dark Theme)
   ============================================================ */
:root {
    --color-bg: #f7f9fb;
    --color-surface: #ffffff;
    --color-text: #191c1e;
    --color-text-muted: #45464d;
    --color-primary: #000000;
    --color-on-primary: #ffffff;
    --color-secondary: #0058be;
    --color-secondary-bg: #dae2fd;
    --color-border: #e0e3e5;
    --color-card-bg: #ffffff;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-headline-md: 30px;
    --font-label-sm: 12px;
}
html.dark {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #e8eaed;
    --color-text-muted: #9aa0a6;
    --color-primary: #ffffff;
    --color-on-primary: #000000;
    --color-secondary: #8ab4f8;
    --color-secondary-bg: #1e3a5f;
    --color-border: #2d2d2d;
    --color-card-bg: #1e1e1e;
}

/* ============================================================
   2.  RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
}
img {
    display: block;
    max-width: 100%;
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   3.  ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

/* ============================================================
   4.  GLOBAL UTILITIES
   ============================================================ */
.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 8px;
}
.section-title {
    font-size: var(--font-headline-md);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
@media (max-width: 640px) {
    .section-title { font-size: 28px; }
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
}
.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
}
.btn--primary:hover { opacity: 0.85; }
.btn--outline {
    background: transparent;
    color: var(--color-secondary);
    border: 1.5px solid var(--color-secondary);
}
.btn--outline:hover {
    background: var(--color-secondary);
    color: white;
}
.btn--sm { padding: 8px 20px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }

/* ============================================================
   5.  HEADER (FINAL VERSION WITH FIXES)
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(8px);
    transition: background 0.3s;
    width: 100%;
}
.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}
.site-header__logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;          /* Menjaga logo tetap ada */
    align-items: center;
    flex-shrink: 0;         /* Mencegah logo menciut sampai 0px */
}
.site-header__logo span { color: var(--color-secondary); }
.site-header__nav-list {
    display: flex;
    gap: 28px;
    align-items: center;
}
.site-header__nav-list a {
    font-size: 15px;
    color: var(--color-text-muted);
    transition: color 0.2s;
    font-weight: 500;
}
.site-header__nav-list a:hover,
.site-header__nav-list a.active { color: var(--color-secondary); }
.site-header__nav-list a.active {
    border-bottom: 2px solid var(--color-secondary);
    padding-bottom: 4px;
}
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;         /* Mencegah actions menciut */
}
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    align-items: center;
}
.site-header__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;

    /* --- PERBAIKAN HAMBURGER --- */
    padding: 10px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.site-header__hamburger span {
    width: 24px;
    height: 3px;            
    background: var(--color-text);
    border-radius: 2px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .site-header__hamburger { display: flex; }
    
    /* Keadaan menu tertutup */
    .site-header__nav {
        display: block;
        visibility: hidden;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--color-surface);
        padding: 24px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }
    
    /* Keadaan menu terbuka! (Saat JS menambahkan class is-open) */
    .site-header__nav.is-open {
        display: flex !important;
        visibility: visible !important;
        flex-direction: column;
        transform: translateY(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 9999 !important; /* Memaksa menu berada di atas konten lain */
    }
    
    .site-header__nav-list {
        flex-direction: column;
        gap: 16px;
    }
    .site-header__actions .btn--sm { display: none; }
    
    .site-header__inner {
        width: 100%;
        gap: 8px;
    }
    .site-header__actions {
        gap: 4px;
    }
}

/* ============================================================
   6.  HERO
   ============================================================ */
.hero {
    position: relative;
    padding-top: 120px;
    padding-bottom: 80px;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 70% 30%, var(--color-secondary-bg) 0%, transparent 70%);
    opacity: 0.15;
}
.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    width: 100%;
}
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 4px 12px;
    background: var(--color-secondary-bg);
    color: var(--color-text);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 20px;
}
.hero__title {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.hero__title span { color: var(--color-secondary); }
.hero__subtitle {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}
.hero__desc {
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 480px;
    margin-bottom: 28px;
    line-height: 1.7;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.hero__avatar {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1/1;
    border-radius: 24px;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero__orb {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 180px;
    height: 180px;
    background: var(--color-secondary);
    border-radius: 50%;
    opacity: 0.12;
    z-index: 0;
}
.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
}
.hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}
.hero__scroll span {
    width: 20px;
    height: 32px;
    border: 2px solid var(--color-text-muted);
    border-radius: 12px;
    display: block;
    position: relative;
}
.hero__scroll span::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--color-secondary);
    border-radius: 4px;
    animation: float 2s ease-in-out infinite;
}
@media (max-width: 768px) {
    .hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero__title { font-size: 38px; }
    .hero__desc { margin-left: auto; margin-right: auto; }
    .hero__actions { justify-content: center; }
    .hero__avatar { max-width: 280px; }
    .sm-only { display: block; }
}
@media (min-width: 769px) { .sm-only { display: none; } }

/* ============================================================
   7.  STATS
   ============================================================ */
.stats {
    padding: 48px 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.stats__inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--color-card-bg);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}
.stat-item__icon {
    font-size: 32px;
    color: var(--color-secondary);
}
.stat-item__number {
    font-size: 24px;
    font-weight: 700;
}
.stat-item__label {
    font-size: 13px;
    color: var(--color-text-muted);
}
@media (max-width: 768px) {
    .stats__inner { grid-template-columns: 1fr; }
}

/* ============================================================
   8.  ABOUT
   ============================================================ */
.about {
    padding: 80px 0;
}
.about__inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
}
.about__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.about__body p {
    font-size: 18px;
    color: var(--color-text-muted);
    line-height: 1.7;
}
.about__meta {
    display: flex;
    gap: 32px;
    margin-top: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}
.about__meta-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}
.about__meta-value {
    font-weight: 600;
    font-size: 16px;
}
.about__values {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}
.value-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px 6px 12px;
    background: var(--color-secondary-bg);
    color: var(--color-text);
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
}
.value-chip .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-secondary);
}
@media (max-width: 768px) {
    .about__inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ============================================================
   9.  SKILLS
   ============================================================ */
.skills {
    padding: 80px 0;
    background: var(--color-bg);
}
.skills__head {
    text-align: center;
    margin-bottom: 48px;
}
.skills__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}
.skills__bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.skill-bar__header {
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    margin-bottom: 4px;
}
.skill-bar__track {
    height: 6px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}
.skill-bar__fill {
    height: 100%;
    background: var(--color-secondary);
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.skills__chips {
    display: flex;
    flex-wrap: wrap;
    align-content: start;
    gap: 12px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}
.chip .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-secondary);
}
@media (max-width: 768px) {
    .skills__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   10. PROJECTS
   ============================================================ */
.projects {
    padding: 80px 0;
}
.projects__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    flex-wrap: wrap;
    gap: 16px;
}
.projects__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.project-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.project-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
    border-color: var(--color-secondary);
    transform: translateY(-4px);
}
.project-card__image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--color-surface);
}
.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.project-card:hover .project-card__image img {
    transform: scale(1.02);
}
.project-card:first-child .project-card__image img {
    object-position: center 10%;
}
.project-card--portrait .project-card__image {
    aspect-ratio: 16 / 9;
    background: #f8f9fa;
    padding: 0;
    overflow: hidden;
}
.project-card--portrait .project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 90%;
    transition: transform 0.4s ease;
    background: #ffffff;
}
.project-card--portrait:hover .project-card__image img {
    transform: scale(1.03);
}
.project-card__body {
    padding: 24px;
}
.project-card__tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.project-card__tags span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 12px;
    background: var(--color-bg);
    border-radius: 20px;
    color: var(--color-text-muted);
}
.project-card__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}
.project-card__desc {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--color-secondary);
    transition: gap 0.2s;
}
.project-card__link:hover { gap: 12px; }
@media (max-width: 768px) {
    .projects__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   11. CONTACT / CTA
   ============================================================ */
.contact {
    padding: 80px 0;
    background: var(--color-bg);
}
.contact__card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    background: var(--color-card-bg);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--color-border);
}
.contact__title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}
.contact__desc {
    color: var(--color-text-muted);
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 32px;
}
.contact__details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contact__details div {
    display: flex;
    align-items: center;
    gap: 12px;
}
.contact__details .material-symbols-outlined {
    color: var(--color-secondary);
}
.contact__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-weight: 500;
    font-size: 14px;
}
.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border 0.2s;
    font-size: 15px;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-secondary);
}
.form-error {
    color: #dc2626;
    font-size: 13px;
    display: none;
}
.form-group.error .form-error { display: block; }
.form-group.error input,
.form-group.error textarea { border-color: #dc2626; }
.form-success {
    display: none;
    align-items: center;
    gap: 8px;
    color: #16a34a;
    font-weight: 500;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 8px;
}
.form-success.show { display: flex; }
@media (max-width: 768px) {
    .contact__card {
        grid-template-columns: 1fr;
        padding: 24px;
    }
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}
.site-footer__brand {
    flex: 0 0 auto;
}
.site-footer__logo {
    font-size: 22px;
    font-weight: 800;
}
.site-footer__logo span { color: var(--color-secondary); }
.site-footer__tagline {
    font-size: 14px;
    color: var(--color-text-muted);
}
.site-footer__nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1 1 auto;
}
.site-footer__nav a {
    font-size: 14px;
    color: var(--color-text-muted);
    transition: color 0.2s;
}
.site-footer__nav a:hover { color: var(--color-secondary); }
.site-footer__social {
    display: flex;
    gap: 16px;
    flex: 0 0 auto;
}
.site-footer__social a {
    padding: 6px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    display: flex;
    transition: all 0.2s;
}
.site-footer__social a:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}
.site-footer__copy {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-left: auto;
    flex: 0 0 auto;
    text-align: right;
}
@media (max-width: 768px) {
    .site-footer__inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .site-footer__brand {
        text-align: center;
    }
    .site-footer__nav {
        justify-content: center;
    }
    .site-footer__social {
        justify-content: center;
    }
    .site-footer__copy {
        margin-left: 0;
        text-align: center;
        width: 100%;
    }
}

/* ============================================================
   13. BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 99;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,88,190,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: scale(1.05);
    background: var(--color-primary);
    color: var(--color-on-primary);
}
.back-to-top .material-symbols-outlined {
    font-size: 24px;
}
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}