/* ==========================================================
           THEME VARIABLES
        ========================================================== */
:root {
    --primary: #1b7f79;
    --secondary: #9ae6b4;

    --bg-main: #ffffff;
    --bg-soft: #dbfaf2;
    --bg-card: #ffffff;

    --text-main: #1f2937;
    --text-muted: #6b7280;

    --border-soft: #e5e7eb;
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-soft: #020617;
    --bg-card: #020617;

    --text-main: #e5e7eb;
    --text-muted: #9ca3af;

    --border-soft: #1e293b;
}

/* ==========================================================
           GLOBAL
        ========================================================== */
body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto;
}

.text-muted {
    color: var(--text-muted) !important;
}

footer,
.navbar {
    background: var(--bg-main);
    border-color: var(--border-soft);
}

header {
    background: var(--bg-main);
}

#about {
    background: var(--bg-soft);
}

/* ==========================================================
           BUTTON
        ========================================================== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #145f5a;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

/* ==========================================================
           GRADIENT
        ========================================================== */
.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-circle {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 0 10px rgba(27, 127, 121, 0.25),
        0 20px 50px rgba(27, 127, 121, 0.25);
}

[data-theme="dark"] .bg-gradient-circle {
    box-shadow: 0 0 0 10px rgba(154, 230, 180, 0.25),
        0 20px 60px rgba(154, 230, 180, 0.15);
}

/* ==========================================================
           AVATAR
        ========================================================== */
.avatar {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--bg-card);
    padding: 6px;
    object-position: center top;
}

/* ==========================================================
           CARD & PROJECT
        ========================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: background 0.3s ease, border 0.3s ease;
}

.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.project-card img {
    height: 180px;
    object-fit: cover;
    background: var(--bg-soft);
}

.cert-card {
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.cert-img {
    height: 180px;
    object-fit: cover;
    background: var(--bg-soft);
}

/* ==========================================================
   SOCIAL LINKS
========================================================== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-link {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: var(--bg-card);
    transition: all 0.3s ease;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(27, 127, 121, 0.25);
}

/* ==========================================================
           TYPOGRAPHY FIX
        ========================================================== */
h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.nav-link,
.navbar-brand {
    color: var(--text-main) !important;
}

.text-uppercase {
    text-transform: uppercase;
}

/* ==========================================================
           THEME TOGGLE ICON
        ========================================================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
}

.theme-toggle svg {
    transition: all 0.35s ease;
}

#icon-sun {
    display: none;
}

[data-theme="dark"] #icon-moon {
    display: none;
}

[data-theme="dark"] #icon-sun {
    display: block;
}

/* ==========================================================
   HERO INTRO ANIMATION
========================================================== */
.hero-intro {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 1s ease forwards;
}

.hero-intro.delay-1 {
    animation-delay: 0.2s;
}

.hero-intro.delay-2 {
    animation-delay: 0.4s;
}

.hero-intro.delay-3 {
    animation-delay: 0.6s;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
           RESPONSIVE
        ========================================================== */
@media (max-width: 768px) {
    .avatar {
        width: 220px;
        height: 220px;
    }

    header {
        text-align: center;
    }

    header .btn {
        margin-top: 1rem;
    }

    .project-card img {
        height: auto;
        object-fit: contain;
    }

    .cert-img {
        height: auto;
        object-fit: contain;
    }
}

/* ==========================================================
   MOBILE TYPOGRAPHY OPTIMIZATION
========================================================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.6;
    }

    /* HERO */
    header h1 {
        font-size: 1.6rem;
        /* dari display-4 jadi lebih ramah HP */
        line-height: 1.35;
    }

    header .lead {
        font-size: 0.95rem;
    }

    header p {
        font-size: 0.85rem;
    }

    /* NAVBAR */
    .navbar-brand {
        font-size: 1rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    /* BUTTON */
    .btn-lg {
        font-size: 0.85rem;
        padding: 0.45rem 0.9rem;
    }

    .btn {
        font-size: 0.8rem;
    }

    .mybuttons {
        flex-direction: column;
        gap: 0.1rem;
    }

    /* SECTION TITLE */
    section h2 {
        font-size: 1.35rem;
    }

    /* ABOUT TEXT */
    #about .lead {
        font-size: 0.95rem;
    }

    #about p {
        font-size: 0.85rem;
    }

    /* CARD PROJECT */
    .card-title {
        font-size: 0.95rem;
    }

    .card-body p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    /* FOOTER */
    footer {
        font-size: 0.75rem;
    }
}
