:root {
    --bg-dark: #080b18;
    --card-bg: rgba(20, 24, 45, 0.4);
    --card-hover: rgba(30, 38, 70, 0.6);
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --accent: #a855f7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-hover: rgba(255, 255, 255, 0.25);
    --glass-reflection: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    --selection-bg: rgba(79, 70, 229, 0.3);
    --nav-height: 72px;
}

::selection {
    background-color: var(--selection-bg);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== NAVBAR ========== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: background 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
    background: rgba(8, 11, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--glass-border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.2rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    font-size: 0.9rem;
}

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

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

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

.nav-cta {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.nav-cta:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ========== BACKGROUND ========== */
#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #1a1e35 0%, var(--bg-dark) 100%);
    overflow: hidden;
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bg-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/bg_premium.png') no-repeat center center;
    background-size: cover;
    opacity: 0.35;
    filter: brightness(0.9);
    transform: scale(1.05);
    transition: transform 0.2s ease-out;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-dark) 100%);
}

/* ========== HERO ========== */
header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    padding-top: var(--nav-height);
    position: relative;
    z-index: 10;
}

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

.hero-tag {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 24px;
    letter-spacing: -2px;
    color: #fff;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-suffix {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    color: var(--text-muted);
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 36px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    border-color: var(--primary-light);
    background: rgba(79, 70, 229, 0.1);
    transform: translateY(-3px);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 18px;
    font-size: 1.05rem;
}

/* ========== SECTIONS ========== */
section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 60px;
    line-height: 1.6;
}

/* ========== SERVICES ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--card-bg);
    padding: 36px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--glass-border-hover);
    background: var(--card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.15);
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--primary-light);
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== PORTFOLIO ========== */
#portfolio {
    max-width: 1200px;
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Card base */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass-reflection);
    pointer-events: none;
}

/* Project cards */
.project-card {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-light);
    background: var(--card-hover);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(79, 70, 229, 0.15);
}

.project-card.hidden {
    display: none;
}

.project-card i {
    font-size: 2.8rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(79, 70, 229, 0.4));
}

.project-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(5px);
}

.project-card h4 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.project-card p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: var(--text-muted);
    flex-grow: 1;
    line-height: 1.5;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: gap 0.3s, color 0.3s;
}

.project-link:hover {
    gap: 12px;
    color: #fff;
}

/* ========== TECH STACK ========== */
#tech {
    text-align: center;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    min-width: 100px;
    transition: all 0.3s;
}

.tech-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    background: var(--card-hover);
}

.tech-item i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tech-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========== CONTACT ========== */
.contact-section {
    background: transparent;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-light);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-group select option {
    background: #1a1e35;
    color: var(--text-main);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s;
}

.contact-info-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateX(4px);
}

.contact-info-card i {
    font-size: 1.4rem;
    color: var(--primary-light);
    min-width: 24px;
    text-align: center;
}

.contact-info-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.contact-info-card p,
.contact-info-card a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.contact-info-card a:hover {
    color: var(--primary-light);
}

/* ========== FOOTER ========== */
footer {
    padding: 48px 20px;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1rem;
}

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

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
    margin-top: 16px;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal-element {
    opacity: 1;
    transform: translateY(0);
}

.js-enabled .reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-enabled .reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for grid children */
.js-enabled .services-grid .reveal-element:nth-child(2) { transition-delay: 0.1s; }
.js-enabled .services-grid .reveal-element:nth-child(3) { transition-delay: 0.2s; }
.js-enabled .services-grid .reveal-element:nth-child(4) { transition-delay: 0.3s; }
.js-enabled .services-grid .reveal-element:nth-child(5) { transition-delay: 0.4s; }
.js-enabled .services-grid .reveal-element:nth-child(6) { transition-delay: 0.5s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links,
    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    /* Mobile menu */
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: rgba(8, 11, 24, 0.95);
        backdrop-filter: blur(20px);
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--glass-border);
    }

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

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

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

    .hero-content h1 {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number,
    .stat-suffix {
        font-size: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

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

    section {
        padding: 80px 16px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

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

    .tech-grid {
        gap: 12px;
    }

    .tech-item {
        min-width: 80px;
        padding: 14px 16px;
    }
}
