:root {
    --bg-color: #050505;
    --surface-color: #121212;
    --surface-light: #1e1e1e;
    --primary-color: #fbbf24;
    /* Amber Gold */
    --primary-glow: rgba(251, 191, 36, 0.3);
    --secondary-color: #06b6d4;
    /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.3);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    display: none;
    /* Hidden on touch devices via media query usually, simplified here */
}

@media (min-width: 1024px) {
    .cursor-dot {
        width: 8px;
        height: 8px;
        background-color: var(--primary-color);
        display: block;
    }

    .cursor-outline {
        width: 40px;
        height: 40px;
        border: 1px solid var(--primary-color);
        display: block;
        transition: width 0.2s, height 0.2s, top 0.1s, left 0.1s;
    }
}

/* Typography & Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), white);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.bg-darker {
    background-color: var(--surface-color);
}

.c-purple {
    color: #c084fc;
}

.c-blue {
    color: #60a5fa;
}

.c-green {
    color: #4ade80;
}

.c-red {
    color: #f87171;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--card-border);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-main);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.8);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.logo .highlight {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links .btn-primary {
    color: #000;
    /* Override */
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    /* offset navbar */
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 10;
}

.tagline {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Glassmorphism Cards in Hero */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: absolute;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-card {
    width: 350px;
    height: 220px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 2;
}

.main-card .code-snippet {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: rgb(0 0 0 / 20%);
    padding: 1rem;
    border-radius: 10px;
    width: 100%;
}

.code-line {
    display: block;
}

.icon-large {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.small-card-1 {
    top: -20px;
    right: 0;
    z-index: 3;
    padding: 0.8rem 1.2rem;
    animation: float 6s ease-in-out infinite;
}

.small-card-2 {
    bottom: -10px;
    left: -20px;
    z-index: 3;
    padding: 0.8rem 1.2rem;
    animation: float 8s ease-in-out infinite reverse;
}

.small-card-1 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.small-card-2 i {
    color: #f472b6;
    font-size: 1.5rem;
}

/* Background Glows */
.bg-gradient-1 {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.bg-gradient-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--surface-light);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.service-card .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    color: var(--text-muted);
}

/* Portfolio */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-thumb {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 250px;
    margin-bottom: 1.5rem;
}

.porto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .porto-img {
    transform: scale(1.1);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .placeholder-img {
    transform: scale(1.1);
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.thumb-overlay i {
    font-size: 2rem;
    color: #fff;
    background: var(--primary-color);
    padding: 1rem;
    border-radius: 50%;
    transform: translateY(20px);
    transition: var(--transition);
}

.portfolio-item:hover .thumb-overlay {
    opacity: 1;
}

.portfolio-item:hover .thumb-overlay i {
    transform: translateY(0);
}

.portfolio-info h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.portfolio-info p {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Stats (About) */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.image-wrapper-glow {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 50px var(--primary-glow);
    position: relative;
    /* Create a glow effect behind the image */
    background: radial-gradient(circle at center, rgba(251, 191, 36, 0.2) 0%, var(--surface-light) 100%);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    height: 400px;
    background: linear-gradient(135deg, #222, #111);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #444;
    border: 2px solid var(--card-border);
}

.stats {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin-top: 2rem;
}

.stats li {
    display: flex;
    flex-direction: column;
}

.stats strong {
    font-size: 2.5rem;
    color: var(--secondary-color);
    font-family: var(--font-heading);
}

.stats span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background: var(--surface-light);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--card-border);
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info>p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--primary-color);
    color: #000;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.w-full {
    width: 100%;
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-btns {
        display: flex;
        justify-content: center;
        gap: 0.8rem;
        flex-wrap: wrap;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
        /* Ensure they don't stretch */
    }

    .hero-btns .btn-secondary {
        margin-left: 0;
    }

    .hero-visual {
        height: 280px;
        margin-top: 1rem;
    }

    .main-card {
        width: 300px;
        height: 180px;
    }

    /* Force 3 columns for Services and Portfolio on mobile as requested */
    .services-grid,
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-top: 2rem;
    }

    /* Adjust content for the small columns */
    .service-card {
        padding: 0.8rem;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .service-card .icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .service-card h3 {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
        line-height: 1.2;
    }

    .service-card p {
        display: none;
        /* Hide description text on mobile to fit 3 columns cleanly, or make it very small */
    }

    .portfolio-thumb {
        height: 120px;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }

    .portfolio-info h4 {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }

    .portfolio-info p {
        font-size: 0.7rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    /* Contact Section adjustments */
    .contact-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 2rem;
    }

    .contact-info h3 {
        font-size: 1.5rem;
    }

    .contact-info>p {
        font-size: 0.9rem;
    }

    /* Fix text overflow for email/phone on small screens */
    .contact-item span {
        word-break: break-all;
        /* Ensures long emails don't cause overflow */
        font-size: 0.95rem;
    }

    /* Adjust form inputs for mobile */
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        font-size: 0.9rem;
        /* Prevent zoom on iOS and fit better */
        padding: 0.8rem;
        /* Slightly smaller padding */
        max-width: 100%;
        /* Ensure no overflow */
    }

    .stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface-light);
        padding: 2rem;
        border-bottom: 1px solid var(--card-border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

/* Extra small screens adjustment to prevent breaking */
@media (max-width: 400px) {

    .services-grid,
    .portfolio-grid {
        /* If 3 is truly too small, user might accept scroll, but they insisted on "tetap 3 bagian". 
           I'll keep it but maybe scale text down further if needed */
        gap: 0.3rem;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }
}