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

:root {
    /* Brand */
    --primary-color: #4f46e5;
    --primary-ink: #3730a3;
    --secondary-color: #06b6d4;
    --accent-color: #a855f7;

    /* Neutrals */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f6f7fb;
    --bg-elevated: #ffffff;
    --bg-dark: #0b1020;
    --border-color: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.16);

    /* Gradients */
    --gradient-1: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #ec4899 0%, #f97316 45%, #fbbf24 100%);
    --gradient-3: linear-gradient(135deg, #22c55e 0%, #06b6d4 55%, #3b82f6 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
    --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.10);
    --shadow-lg: 0 18px 48px rgba(2, 6, 23, 0.14);
    --shadow-xl: 0 30px 80px rgba(2, 6, 23, 0.18);

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 26px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-1: 120ms;
    --dur-2: 220ms;
    --dur-3: 420ms;

    /* Focus ring */
    --ring: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.55;
    overflow-x: hidden;
    background: radial-gradient(1200px 600px at 15% -10%, rgba(79, 70, 229, 0.10), transparent 60%),
                radial-gradient(900px 520px at 95% 0%, rgba(6, 182, 212, 0.10), transparent 55%),
                var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

/* Accessibility + global polish */
a {
    color: inherit;
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.90);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-strong);
}

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

.logo-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--dur-2) var(--ease-out);
    position: relative;
}

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

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--dur-2) var(--ease-out);
}

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

.btn-contact {
    background: var(--gradient-1);
    color: white !important;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), filter var(--dur-2) var(--ease-out);
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.btn-contact:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.26);
}

.btn-contact::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px 520px at 20% 20%, rgba(79, 70, 229, 0.14), transparent 60%),
                radial-gradient(760px 520px at 80% 30%, rgba(6, 182, 212, 0.14), transparent 62%),
                radial-gradient(900px 600px at 50% 100%, rgba(168, 85, 247, 0.10), transparent 55%);
    opacity: 1;
}

.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 44px 44px;
    animation: gridMove 26s linear infinite;
    mask-image: radial-gradient(circle at 50% 25%, black 40%, transparent 75%);
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 3.5rem 0 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    line-height: 1.04;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.04em;
}

.title-line {
    display: block;
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.title-line:nth-child(1) {
    animation-delay: 0.2s;
}

.title-line:nth-child(2) {
    animation-delay: 0.4s;
}

.title-line:nth-child(3) {
    animation-delay: 0.6s;
}

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

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

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.8s forwards;
    opacity: 0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 1s forwards;
    opacity: 0;
}

.btn {
    padding: 0.95rem 1.35rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 60px rgba(79, 70, 229, 0.26);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: var(--shadow-md);
}

.btn-full {
    width: 100%;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 1.2s forwards;
    opacity: 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

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

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(15px); }
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

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

.feature-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.25);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.22);
}

.feature-icon svg {
    width: 30px;
    height: 30px;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Portfolio Section */
.portfolio {
    padding: 6rem 0;
    background: white;
}

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

.portfolio-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-item {
    background: var(--gradient-1);
    border-radius: 16px;
    padding: 2.5rem;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover::before {
    opacity: 1;
}

.portfolio-item:nth-child(2) {
    background: var(--gradient-2);
}

.portfolio-item:nth-child(3) {
    background: var(--gradient-3);
}

.portfolio-item:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.portfolio-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.portfolio-content {
    position: relative;
    z-index: 1;
}

.portfolio-category {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.portfolio-description {
    opacity: 0.95;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.portfolio-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* About Section */
.about {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.125rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

.check-icon {
    width: 24px;
    height: 24px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.visual-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.visual-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.visual-content p {
    color: var(--text-secondary);
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.info-icon svg {
    width: 24px;
    height: 24px;
}

.info-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.info-content p {
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: white;
        width: 100%;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        gap: 1.5rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

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

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

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .hero-stats {
        gap: 2rem;
    }

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

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

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

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

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

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

    .footer-content {
        grid-template-columns: 1fr;
    }
}

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

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

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

    .feature-card,
    .portfolio-item {
        padding: 1.5rem;
    }
}
