/* =============================================
   Ainun Najib - Personal Website V2
   Stable Solutions - Full Page Layout
   ============================================= */

/* Variables */
:root {
    --orange: #f97316;
    --orange-light: #fb923c;
    --orange-dark: #ea580c;
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --purple-dark: #5b21b6;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.04);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.08);
    --gradient: linear-gradient(135deg, var(--orange) 0%, var(--purple) 100%);
    --gradient-text: linear-gradient(135deg, var(--orange-light) 0%, var(--purple-light) 100%);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed navbar */
}

/* Smooth scrolling for all browsers with better performance */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =============================================
   Background Effects
   ============================================= */

.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(249, 115, 22, 0.08) 0%, transparent 50%);
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* =============================================
   Navigation
   ============================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 15px 40px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo img {
    width: 40px;
    height: 40px;
}

.nav-logo span {
    font-weight: 700;
    font-size: 18px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lang-btn:hover {
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--gradient);
    color: white;
}

.nav-cta {
    padding: 10px 24px;
    background: var(--gradient);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.5);
}

/* =============================================
   Hero Section
   ============================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 80px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 900px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--orange-light);
    margin-bottom: 32px;
    animation: fadeUp 0.8s ease-out;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-logo {
    display: block;
    width: 160px;
    height: 160px;
    margin: 0 auto 40px;
    animation: fadeUp 0.8s ease-out 0.1s both;
    filter: drop-shadow(0 20px 40px rgba(249, 115, 22, 0.3));
    object-fit: contain;
}

.hero-title {
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 16px;
    animation: fadeUp 0.8s ease-out 0.2s both;
}

.hero-title .gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-bottom: 8px;
    animation: fadeUp 0.8s ease-out 0.3s both;
}

.hero-tagline-sub {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
    animation: fadeUp 0.8s ease-out 0.35s both;
}

.hero-description {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    animation: fadeUp 0.8s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeUp 0.8s ease-out 0.5s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -15px rgba(249, 115, 22, 0.5);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-3px);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    animation: bounce 2s infinite;
}

.hero-scroll svg {
    width: 24px;
    height: 24px;
}

/* =============================================
   Section Base
   ============================================= */

section {
    padding: 100px 40px;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--orange);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.section-description {
    font-size: 18px;
    color: var(--text-secondary);
}

/* =============================================
   About Section
   ============================================= */

.about {
    background: linear-gradient(180deg, transparent 0%, rgba(249, 115, 22, 0.02) 50%, transparent 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--gradient);
    padding: 3px;
}

.about-image-inner {
    width: 100%;
    height: 100%;
    border-radius: 22px;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.about-image-inner img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.about-stats {
    position: absolute;
    bottom: -20px;
    right: -20px;
    display: flex;
    gap: 12px;
}

.stat-card {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.about-content h3 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 24px;
}

.about-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.highlight-item:hover {
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateX(5px);
}

.highlight-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.highlight-text {
    font-size: 14px;
    font-weight: 600;
}

/* =============================================
   Skills Section
   ============================================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -20px rgba(249, 115, 22, 0.2);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.skill-category-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-category-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.skill-category-title {
    font-size: 20px;
    font-weight: 700;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--orange-light);
}

/* =============================================
   Services Section
   ============================================= */

.services {
    background: linear-gradient(180deg, transparent 0%, rgba(124, 58, 237, 0.02) 50%, transparent 100%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-5px);
}

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

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(124, 58, 237, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.service-icon svg {
    width: 30px;
    height: 30px;
    color: var(--orange);
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-description {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =============================================
   Contact Section
   ============================================= */

.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
}

.contact-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
}

.contact-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: var(--gradient);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(249, 115, 22, 0.4);
}

.contact-link svg {
    width: 22px;
    height: 22px;
}

/* =============================================
   Footer
   ============================================= */

.footer {
    padding: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo img {
    width: 32px;
    height: 32px;
}

.footer-logo span {
    font-weight: 600;
}

.footer-text {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-text .heart {
    color: var(--orange);
    animation: heartbeat 1.5s infinite;
}

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

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--gradient);
    border-color: transparent;
    transform: translateY(-3px);
}

.footer-social svg {
    width: 18px;
    height: 18px;
}

/* =============================================
   Animations
   ============================================= */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Reveal on scroll animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for cards */
.skill-category.reveal-on-scroll,
.service-card.reveal-on-scroll,
.highlight-item.reveal-on-scroll {
    transition-delay: calc(var(--index, 0) * 0.1s);
}

.skill-category:nth-child(1) { --index: 0; }
.skill-category:nth-child(2) { --index: 1; }
.skill-category:nth-child(3) { --index: 2; }

.service-card:nth-child(1) { --index: 0; }
.service-card:nth-child(2) { --index: 1; }
.service-card:nth-child(3) { --index: 2; }
.service-card:nth-child(4) { --index: 3; }

.highlight-item:nth-child(1) { --index: 0; }
.highlight-item:nth-child(2) { --index: 1; }
.highlight-item:nth-child(3) { --index: 2; }
.highlight-item:nth-child(4) { --index: 3; }

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        position: static;
        margin-top: 20px;
        justify-content: center;
    }

    .about-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 16px 20px;
    }

    .nav-links {
        display: none;
    }

    .nav-right {
        gap: 12px;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .nav-cta {
        padding: 8px 16px;
        font-size: 13px;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-logo {
        width: 120px;
        height: 120px;
    }

    section {
        padding: 60px 20px;
    }

    .contact-card {
        padding: 32px 24px;
    }

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

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        margin-bottom: 60px; /* Space for hero-scroll */
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-scroll {
        bottom: 20px;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-link {
        width: 100%;
        justify-content: center;
    }
}
