/* 
    STYLE.CSS - Portofolio Profesional Refined
    Bahasa Indonesia
*/

:root {
    --primary: #000000;
    --secondary: #666666;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.4);
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-light: rgba(255, 255, 255, 0.8);
    --card-dark: rgba(30, 41, 59, 0.7);
    --text-light: #1e293b;
    --text-dark: #f1f5f9;
    --border-light: rgba(0, 0, 0, 0.08);
    --border-dark: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
    --transition-fast: 0.2s ease;
    --transition-base: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);

    /* Newly Added System Variables */
    --text-color: #1e293b;
    --text-muted: #64748b;
    --primary-color: #2563eb;
    --primary-color-rgb: 37, 99, 235;
    --primary-light: #60a5fa;
    --spacing-xs: 8px;
    --spacing-md: 16px;
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px;
    /* Added for section offset */
}

body {
    background-color: var(--bg-light);
    color: var(--text-light);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
    overflow-wrap: break-word;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    width: 100%;
    position: relative;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -1.5px;
}

.highlight {
    background: linear-gradient(120deg, var(--accent), #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.divider {
    width: 60px;
    height: 5px;
    background: var(--accent);
    border-radius: 3px;
    margin-bottom: 30px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-up {
    opacity: 0;
    animation: fadeInUp 0.8s var(--transition-base) forwards;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s var(--transition-base) forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-in-out;
}


/* Sleek Dual Glowing Spinner */
.loader {
    position: relative;
    width: 65px;
    height: 65px;
    margin-bottom: 32px;
}

.loader:before,
.loader:after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
}

.loader:before {
    inset: 0;
    border-top-color: #00eaff;
    border-right-color: #00eaff;
    box-shadow: 0 0 20px rgba(0, 234, 255, 0.4);
    animation: spinNormal 1.2s linear infinite;
}

.loader:after {
    inset: 10px;
    border-bottom-color: var(--accent);
    border-left-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    animation: spinReverse 0.9s linear infinite;
}

@keyframes spinNormal {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.loader-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00eaff;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInText 0.8s ease 0.5s forwards;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 0.85;
        transform: translateY(0);
    }
}

/* Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    /* Increased to be above overlay */
    padding: 20px 0;
    transition: var(--transition-base);
}

header.scrolled {
    padding: 12px 0;
    background: var(--card-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: var(--shadow-soft);
    border-bottom: 1px solid var(--border-light);
}

.dark-mode header.scrolled {
    background: var(--card-dark);
    border-bottom: 1px solid var(--border-dark);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.logo .material-symbols-outlined {
    font-size: 1.7rem;
    color: var(--accent);
}

nav#nav-links {
    display: flex;
    gap: 28px;
}

nav#nav-links a {
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-fast);
    opacity: 0.7;
}

nav#nav-links a:hover,
nav#nav-links a.active {
    opacity: 1;
    color: var(--accent);
}

.nav-actions {
    display: flex;
    gap: 10px;
}

#theme-toggle,
#menu-toggle {
    background: var(--border-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

#menu-toggle {
    display: none;
    /* Default sembunyi di Desktop */
}

.dark-mode #theme-toggle,
.dark-mode #menu-toggle {
    background: var(--border-dark);
}

#theme-toggle:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(15deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--border-light);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.dark-mode .badge {
    background: var(--border-dark);
}

.dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 950;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: -3px;
}

.hero-text p {
    font-size: 1.15rem;
    color: var(--secondary);
    max-width: 500px;
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

.btn {
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.dark-mode .btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--border-light);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

.dark-mode .btn-secondary {
    background: var(--border-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
    color: inherit;
}

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

.btn-outline:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-4px);
}

.w-full {
    width: 100%;
}

.hero-image {
    position: relative;
}

.img-wrapper {
    position: relative;
    z-index: 2;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
    aspect-ratio: 1/1;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: var(--transition-slow);
}

.hero-image:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.img-frame {
    position: absolute;
    top: 20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid var(--accent);
    border-radius: 32px;
    z-index: 1;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
}

.stat-item span {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-item p {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    display: block;
    margin-top: -10px;
}

.glass-card {
    background: var(--card-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-light);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow-soft);
}

.dark-mode .glass-card {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
}

.about-card h3 {
    margin-bottom: 20px;
    font-weight: 800;
}

.about-card p {
    margin-bottom: 24px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-list li .material-symbols-outlined {
    color: var(--accent);
}

.about-card .btn {
    padding: 14px 28px;
    font-size: 0.9rem;
}

.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-strong);
}

/* Projects Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.view-all {
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    transition: var(--transition-base);
}

.view-all:hover {
    background: var(--accent);
    color: #fff;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.card-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: var(--transition-slow);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-base);
}

.card-overlay span {
    font-size: 3rem;
    color: #fff;
    transform: translateY(20px);
    transition: var(--transition-base);
}

.project-card:hover .card-img img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.project-card:hover .card-overlay {
    opacity: 1;
}

.project-card:hover .card-overlay span {
    transform: translateY(0);
}

.card-body {
    padding: 32px;
}

.slider-wrapper {
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 32px;
    position: relative;
}

.slide.card-body h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
}

.card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-demo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(var(--primary-color-rgb), 0.1);
    width: fit-content;
}

.btn-demo:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateX(5px);
}

.btn-demo span {
    font-size: 18px !important;
}

.slider-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
    z-index: 5;
}

.dark-mode .slider-btn {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: #fff;
}

.slider-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.slider-btn:active {
    transform: scale(0.95);
}

.slider-btn span {
    font-size: 1.4rem;
    font-weight: 900;
}

/* Penyesuaian ikon ios (sedikit offset biar pas tengah) */
.slider-btn.prev span {
    margin-left: 8px;
}

.slider-btn.next span {
    margin-left: 4px;
}

.slider-container {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 20px 0;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.cert-card {
    min-width: 400px;
    padding: 16px;
    scroll-snap-align: start;
    transition: var(--transition-base);
}

.cert-img {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.cert-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.medal-placeholder {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.medal-icon {
    font-size: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.medal-icon.silver {
    color: #C0C0C0;
    text-shadow: 0 0 20px rgba(192, 192, 192, 0.5);
    background: radial-gradient(circle, rgba(192, 192, 192, 0.2) 0%, transparent 70%);
}

.medal-icon span {
    font-size: 60px !important;
}

.cert-card:hover .cert-img img {
    transform: scale(1.08);
}

.cert-body {
    padding: 0 12px 12px;
}

/* Skills Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.project-card {
    border-radius: 28px;
    overflow: hidden;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

.dark-mode .project-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.skill-category {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 35px;
    border-radius: 28px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.dark-mode .skill-category {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.skill-category:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px var(--accent-glow);
}

.skill-category:hover::before {
    opacity: 0.1;
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.cat-header .material-symbols-outlined {
    font-size: 2rem;
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.cat-header h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 850;
    color: var(--text-color);
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.tag {
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.dark-mode .tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 10px 20px var(--accent-glow);
    border-color: transparent;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Contact Section REFINED */
.contact-card {
    padding: 0;
    overflow: hidden;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
}

.contact-info {
    padding: 64px;
    background: var(--primary);
    color: #fff;
}

.dark-mode .contact-info {
    background: #1e293b;
}

.contact-info p {
    opacity: 0.7;
    margin-bottom: 48px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.detail-item .material-symbols-outlined {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.detail-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    opacity: 0.5;
}

.detail-item .value {
    font-weight: 700;
    font-size: 1.1rem;
    opacity: 1;
    word-break: break-word;
}

.contact-form-refined {
    padding: 64px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea {
    background: transparent;
    border: 2px solid var(--border-light);
    padding: 16px;
    border-radius: 12px;
    color: inherit;
    font-size: 1rem;
    transition: var(--transition-base);
}

.dark-mode .input-group input,
.dark-mode .input-group textarea {
    border-color: var(--border-dark);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.05);
}

.btn-full-width {
    width: 100%;
}

.btn-animated {
    position: relative;
    overflow: hidden;
}

.btn-animated span {
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    padding: 80px 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    color: var(--text-light) !important;
    font-size: 1.25rem;
    transition: var(--transition-base);
    text-decoration: none;
}

.dark-mode .social-icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark) !important;
}

.social-icon:hover {
    background: var(--accent);
    color: #fff !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--accent-glow);
}

/* Project Card Button REFINED */
.btn-text {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--accent);
    cursor: pointer;
    padding: 12px 0;
    transition: var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 1px;
    appearance: none;
    -webkit-appearance: none;
}

.btn-text span {
    transition: var(--transition-base);
}

.btn-text:hover span {
    transform: translateX(5px);
}

.dark-mode .btn-text {
    color: #93c5fd;
}

.btn-top-floating {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px var(--accent-glow);
    z-index: 100;
    transition: var(--transition-base);
    opacity: 0;
    pointer-events: none;
}

.btn-top-floating.visible {
    opacity: 1;
    pointer-events: auto;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* MODAL POPUP REBORN */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-content {
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 32px;
    position: relative;
    overflow-y: auto;
    /* Changed for scrolling */
    background: var(--bg-light);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark-mode .modal-content {
    background: #111827;
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 32px;
    font-weight: 300;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.close-modal:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    height: auto;
    min-height: 100%;
}

.modal-img {
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    background: #f8fafc;
    /* Light gray background for contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dark-mode .modal-img {
    background: #0f172a;
    /* Darker slate for dark mode */
}

.modal-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Don't crop the screenshots! */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-info {
    padding: 48px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    gap: 24px;
}

.modal-info h2 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.tech-stack h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.modal-btns {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding-top: 24px;
}

.modal-btns .btn {
    flex: 1;
    justify-content: center;
    padding: 16px;
}

/* ============================================
   RESPONSIVE - Mobile-First, All Devices
   ============================================ */

/* === TABLET LANDSCAPE (max 1100px) === */
@media (max-width: 1100px) {
    .container {
        padding: 0 40px;
    }

    .hero {
        padding-top: 120px;
    }

    /* Explicit padding to prevent sticky navbar overlap */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        margin: 0 auto 24px;
        font-size: 3.5rem;
    }

    .hero-text p {
        margin: 0 auto 40px;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-image {
        max-width: 400px;
        margin: 40px auto 0;
    }

    .about-grid {
        gap: 40px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .modal-content {
        max-height: 95vh;
        margin: 10px;
        border-radius: 24px;
        width: calc(100% - 20px);
    }

    .modal-body {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .modal-img {
        height: auto;
        min-height: 200px;
        padding: 60px 20px 20px;
        background: #f1f5f9;
        border-bottom: 1px solid var(--border-light);
    }

    .dark-mode .modal-img {
        background: #1e293b;
        border-bottom: 1px solid var(--border-dark);
    }

    .modal-info {
        padding: 32px 24px;
        gap: 20px;
        text-align: center;
        align-items: center;
    }

    .modal-info h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .logo-text {
        font-size: 0.95rem;
        white-space: nowrap;
        max-width: none;
    }

    /* Prevents text wrapping/tall navbar */
    .hero {
        padding-top: 110px;
    }

    /* Prevent navbar overlap */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    /* Skill cards layout */
    .cert-card {
        min-width: 260px;
        padding: 10px;
    }

    .cert-info h3 {
        font-size: 1.1rem;
    }

    .cert-info p {
        font-size: 0.85rem;
    }

    .slider-wrapper {
        gap: 10px;
    }

    .slider-btn {
        width: 36px;
        height: 36px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .skill-category h3 {
        font-size: 1.2rem;
    }

    nav#nav-links {
        position: fixed;
        top: 80px;
        /* Aligns with navbar height */
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        background: #ffffff !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
        gap: 0;
        z-index: 2100;
        /* Inside header stacking context */
        overflow: hidden;
        transition: all 0.4s ease-in-out;
        opacity: 0;
        pointer-events: none;
        border-bottom: 2px solid var(--accent);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        transform: none;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    header.scrolled nav#nav-links {
        top: 64px;
        /* Matches scrolled smaller navbar height */
    }

    .dark-mode nav#nav-links {
        background: #0f172a !important;
        border-bottom: 2px solid var(--primary-light);
    }

    nav#nav-links.active {
        max-height: 500px;
        padding: 20px 0;
        opacity: 1;
        pointer-events: auto;
    }

    nav#nav-links a {
        font-size: 1.1rem;
        font-weight: 700;
        width: 100%;
        padding: 18px 30px;
        color: var(--text-color) !important;
        text-align: left;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .dark-mode nav#nav-links a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #menu-toggle {
        display: flex;
        z-index: 1002;
        margin-left: auto;
        border: none;
        background: transparent;
        color: var(--text-color);
        cursor: pointer;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 1500;
        /* Above content, below header */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .contact-info,
    .contact-form-refined {
        padding: 40px 24px;
    }

    .btn-top-floating {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    /* Modal Mobile */
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-img {
        min-height: 250px;
    }

    .modal-info {
        padding: 32px 24px;
    }

    /* Footer Mobile Specific */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero {
        padding-top: 100px;
        align-items: flex-start;
    }

    /* Lowered Hero content */
    .hero-text h1 {
        font-size: 1.5rem;
        line-height: 1.2;
        letter-spacing: -0.5px;
        margin-top: 5px;
    }

    .hero-text h1 br {
        display: none;
    }

    .badge {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    /* Repositioned badge */
    .hero-text p {
        font-size: 0.85rem;
        margin-bottom: 25px !important;
    }

    .stats {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Fix stats overflow */
    .stat-item h3 {
        font-size: 1.8rem;
    }

    .hero-btns {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 0.9rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Skills stack on small mobile */
    .glass-card {
        padding: 24px;
    }

    /* Reduce padding on mobile */
    .contact-info,
    .contact-form-refined {
        padding: 32px 16px;
    }

    /* Fix contact padding mobile */
    .detail-item .value {
        font-size: 0.95rem;
    }

    /* Reduce email size slightly */
    .modal-btns {
        flex-direction: column;
        width: 100%;
    }

    .modal-btns .btn {
        width: 100%;
        flex: none;
        font-size: 0.9rem;
        padding: 14px;
    }

    .close-modal {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 0.9rem;
        max-width: none;
        white-space: nowrap;
    }

    /* Fix Sertifikat Mobile */
    .slider-wrapper {
        gap: 10px;
        padding: 0 10px;
    }

    .cert-card {
        min-width: 280px;
        /* Safer than 100vw which causes overflow */
        flex: 1 0 85%;
        padding: 12px;
    }

    .cert-img {
        margin-bottom: 15px;
    }

    .cert-body h4 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .cert-provider {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }

    .cert-id {
        font-size: 0.75rem;
    }

    .slider-btn {
        width: 45px;
        height: 45px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9) !important;
        color: #000 !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

    .dark-mode .slider-btn {
        background: rgba(30, 41, 59, 0.9) !important;
        color: #fff !important;
    }

    .slider-btn.prev {
        left: -5px;
    }

    .slider-btn.next {
        right: -5px;
    }

    .slider-btn span {
        font-size: 1.1rem;
    }

    .slider-btn.prev span {
        margin-left: 5px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   Mencegah repaint/reflow berlebih saat scroll
   ============================================ */

/* GPU layer untuk elemen animasi loader */
.loader::before,
.loader::after {
    will-change: transform;
}

/* GPU hint untuk scroll-animated elements */
.fade-up,
.fade-in,
.animate-on-scroll {
    will-change: opacity, transform;
}

/* Naikkan kartu ke GPU layer agar hover tidak trigger repaint global */
.project-card,
.cert-card,
.glass-card {
    transform: translateZ(0);
}

/* Isolasi layout tiap section - scroll tidak trigger reflow seluruh halaman */
section {
    contain: layout style;
}

/* Slider: hardware-accelerated scroll */
.slider-container {
    -webkit-overflow-scrolling: touch;
}