@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Outfit:wght@300;400;600;700;800&display=swap');

:root {
    --primary: #8e24aa;
    --primary-dark: #7b1fa2;
    --secondary: #ba68c8;
    --accent: #ce93d8;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Glassmorphism Components */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

nav.scrolled {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Comfortaa', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--white) !important;
}

.logo img {
    height: 48px;
    width: auto;
    border-radius: 50%;
}

.logo span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a:hover {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 140px;
    /* Space for navbar */
    padding-bottom: 60px;
}

.hero.subpage-hero {
    min-height: 35vh;
    justify-content: flex-start;
    padding-top: 180px;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    opacity: 0.15;
    filter: blur(80px);
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    opacity: 0.1;
    filter: blur(80px);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.hero-tagline {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2.5rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--white);
    margin-left: 1rem;
}

.btn-outline:hover {
    background: var(--glass);
    border-color: var(--primary);
}

/* Sections */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    display: block;
}

.service-card h3 {
    margin-bottom: 1rem;
}

.service-card ul {
    margin-top: 1.5rem;
}

.service-card li {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-card li::before {
    content: '→';
    color: var(--accent);
}

/* Feature Grid (for service pages) */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Portfolio Page Specific */
.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

/* --- Premium Visual Portfolio (Balanced Bento) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background: var(--dark-lighter);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    display: block;
}

/* Perfect 3-Column Balance for 4 Items */
.item-featured {
    grid-column: span 2;
    grid-row: span 1;
}

.item-tall {
    grid-row: span 2;
}

.item-regular {
    grid-column: span 1;
    grid-row: span 1;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    filter: brightness(0.9);
}

.portfolio-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(139, 92, 246, 0.2);
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.08);
    filter: brightness(0.6);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top,
            rgba(15, 23, 42, 0.9) 0%,
            rgba(15, 23, 42, 0.4) 40%,
            transparent 80%);
    z-index: 2;
}

.portfolio-tag {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 3;
}

.portfolio-overlay h3 {
    font-size: 1.8rem;
    font-family: 'Comfortaa', cursive;
    color: white;
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.btn-tiny {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    /* Pill shape as requested */
    font-size: 0.55rem;
    font-weight: 800;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    width: fit-content;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-tiny i {
    font-size: 0.55rem;
}

.portfolio-item:hover .btn-tiny {
    background: var(--primary);
    /* Vibrant color change on hover */
    color: white !important;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(142, 36, 170, 0.4);
}

.portfolio-item:hover .btn-tiny i {
    transform: translateX(3px) rotate(-45deg);
}

.btn-tiny:active {
    transform: scale(0.95);
}

/* Glow Effects */
#portfolio {
    position: relative;
    overflow: hidden;
}

#portfolio::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(142, 36, 170, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
}

#portfolio::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

/* Contact Info */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
textarea {
    background: var(--dark-lighter);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--white);
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Footer */
footer {
    padding: 80px 0 40px;
    background: var(--dark-lighter);
    border-top: 1px solid var(--glass-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 60px;
}

.footer-brand h2 {
    margin-bottom: 1.5rem;
}

.footer-links h4 {
    margin-bottom: 1.5rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .project-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card div:nth-child(2) {
        order: 2;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        background: var(--dark);
        flex-direction: column;
        justify-content: center;
        transition: 0.5s;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .hero p {
        font-size: 1rem;
    }

    .section-header h2 {
        font-size: clamp(1.8rem, 6vw, 2.2rem);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Portfolio Visual Feast Reset for Mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 400px;
        gap: 1.5rem;
    }

    .item-featured,
    .item-tall,
    .item-regular {
        grid-column: auto;
        grid-row: auto;
    }

    .portfolio-tag {
        opacity: 1;
        transform: translateY(0);
        background: var(--gradient);
    }

    .portfolio-overlay {
        padding: 1.5rem;
    }

    .portfolio-item {
        height: 400px;
    }

    .portfolio-overlay h3 {
        font-size: 1.3rem;
    }

    .btn-tiny {
        padding: 0.7rem 1.2rem;
        font-size: 0.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-outline {
        margin-left: 0;
        margin-top: 1rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 60px 0;
    }
}