:root {
    --bg-color: #0b0f19;
    --surface-color: #111827;
    --surface-card: #1f2937;
    --surface-glass: rgba(17, 24, 39, 0.94);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --primary-color: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.25);
    --border-color: #374151;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
}

[data-theme="cyan"] {
    --primary-color: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.25);
}

[data-theme="green"] {
    --primary-color: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.25);
}

[data-theme="amber"] {
    --primary-color: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.25);
}

[data-theme="purple"] {
    --primary-color: #a855f7;
    --primary-glow: rgba(168, 85, 247, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

/* Background High-Tech Elements */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -2;
    opacity: 0.35;
    pointer-events: none;
    max-width: 100%;
}

.shape-1 {
    top: -10%;
    right: -5%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0,0,0,0) 70%);
}

.shape-2 {
    bottom: 20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0,0,0,0) 70%);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.section-padding {
    padding: 5rem 0;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.text-accent {
    color: var(--primary-color);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.glass-nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    z-index: 1001;
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.8rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.mobile-menu-btn .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.open .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.open .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.theme-dot.active {
    transform: scale(1.25);
    border-color: #ffffff;
}

.dot-cyan { background-color: #06b6d4; }
.dot-green { background-color: #10b981; }
.dot-amber { background-color: #f59e0b; }
.dot-purple { background-color: #a855f7; }

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

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: center;
}

.hero-content {
    max-width: 600px;
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 340px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: 0 15px 35px var(--primary-glow);
    position: relative;
    z-index: 2;
    transition: all 0.5s ease-in-out;
    animation: morph 8s ease-in-out infinite;
}

.hero-image-backdrop {
    position: absolute;
    width: 100%;
    max-width: 340px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-glow), rgba(168, 85, 247, 0.2));
    border-radius: 50%;
    z-index: 1;
    filter: blur(30px);
    transform: scale(1.1);
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border: 1px solid var(--primary-glow);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    min-height: 44px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #0b0f19;
    border: 1px solid var(--primary-color);
    font-weight: 700;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

.terminal-icon {
    font-family: var(--font-mono);
    font-weight: bold;
    margin-right: 6px;
}

/* Section Header */
.section-header {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.title-underline {
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Telemetry Section */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.telemetry-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.35rem;
    transition: var(--transition);
}

.telemetry-card:hover {
    border-color: var(--primary-color);
}

.telemetry-card .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.8rem;
}

.telemetry-card .card-header h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-icon {
    font-size: 1.2rem;
}

.telemetry-value {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.telemetry-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.4rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s ease;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
}

.about-text h3 {
    font-size: 1.35rem;
    margin-bottom: 1.2rem;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.skills-container h3 {
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.skill-item {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    padding: 0.55rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.skill-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Category Filters - Scrollable Container on Mobile */
.category-filters-wrapper {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    margin-bottom: 2rem;
    padding-bottom: 4px;
}

.category-filters-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-filters {
    display: flex;
    gap: 0.6rem;
    width: max-content;
}

.filter-btn {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.55rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    min-height: 40px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: #0b0f19;
    border-color: var(--primary-color);
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

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

.project-title {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.tech-tag {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-weight: 500;
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
}

.project-link::after {
    content: '→';
    margin-left: 5px;
    transition: var(--transition);
}

.project-link:hover::after {
    transform: translateX(4px);
}

/* Contact Section */
.contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.glass-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-glow);
}

.form-status {
    margin-top: 1rem;
    font-size: 0.88rem;
    text-align: center;
    font-weight: 500;
}

.form-status.success { color: #10b981; }
.form-status.error { color: #ef4444; }

/* Interactive Terminal CLI Overlay */
.cli-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cli-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.cli-window {
    width: 100%;
    max-width: 720px;
    height: min(480px, 80vh);
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-mono);
}

.cli-header {
    background: #111827;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: relative;
}

.cli-buttons {
    display: flex;
    gap: 8px;
}

.cli-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close-btn { background: #ef4444; }
.min-btn { background: #f59e0b; }
.max-btn { background: #10b981; }

.cli-title {
    margin: 0 auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cli-body {
    flex-grow: 1;
    padding: 0.9rem;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e5e7eb;
}

.cli-line {
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.cmd-highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.cli-input-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.9rem;
    background: #0d1322;
    border-top: 1px solid var(--border-color);
}

.cli-prompt {
    color: #10b981;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 8px;
    white-space: nowrap;
}

.cli-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.cli-input:focus {
    outline: none;
}

/* Floating CLI Trigger */
.floating-cli-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface-card);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.6rem 1.1rem;
    border-radius: 50px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    z-index: 990;
    transition: var(--transition);
}

.floating-cli-btn:hover {
    background: var(--primary-color);
    color: #0b0f19;
    transform: scale(1.05);
}

/* Pulse dots */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.pulse-dot.green {
    background-color: #10b981;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-green 2s infinite;
}

/* Loading spinner */
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    background: var(--surface-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-card);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE BREAKPOINTS (Handphones & Tablets)
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .section-padding {
        padding: 4rem 0;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        transform: translateY(-200%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        width: 100%;
    }

    .nav-links a {
        font-size: 1.05rem;
    }

    .hero {
        min-height: auto;
        padding-top: 85px;
        padding-bottom: 2rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-image-wrapper {
        order: -1;
    }

    .hero-image {
        max-width: 200px;
    }

    .hero-image-backdrop {
        max-width: 200px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .skills-grid {
        justify-content: center;
    }

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

    .contact-form-wrapper .glass-card {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .floating-cli-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }
}

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

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-desc {
        font-size: 0.92rem;
    }

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

    .telemetry-card {
        padding: 1.1rem;
    }

    .telemetry-value {
        font-size: 1.1rem;
    }

    .cli-modal {
        padding: 0.5rem;
    }

    .cli-window {
        height: 85vh;
        border-radius: 8px;
    }

    .cli-prompt {
        font-size: 0.78rem;
    }

    .cli-input {
        font-size: 0.85rem;
    }
}