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

:root {
    --primary-color: #06b6d4;
    --secondary-color: #0f172a;
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --border-color: rgba(34, 211, 238, 0.2);
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --card-bg: rgba(15, 23, 42, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Header */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: bold;
    font-size: 1rem;
}

.logo-icon {
    width: 4.5rem;
    height: 4.5rem;
    fill: var(--primary-color);
    transition: all 0.3s;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5));
}

.logo:hover .logo-icon {
    fill: #0891b2;
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.7));
}

.nav {
    display: flex;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

.desktop-nav {
    display: none;
}

.desktop-cta {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
    
    .desktop-cta {
        display: inline-block;
    }
    
    .menu-toggle {
        display: none;
    }
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.mobile-nav.active {
    display: flex;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: block;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background-color: #0891b2;
}

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

.btn-outline:hover {
    background: rgba(6, 182, 212, 0.1);
}

.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}

/* Hero Section */
.hero {
    position: relative;
    padding-top: 8rem;
    padding-bottom: 5rem;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr 1fr;
    }
}

.hero-subtitle {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-subtitle {
        text-align: left;
    }
}

.hero-title {
    font-size: 2.25rem;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
        text-align: left;
    }
}

.hero-title .highlight {
    color: var(--primary-color);
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-description {
        text-align: left;
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero-buttons {
        justify-content: flex-start;
    }
}

.hero-visual {
    /* default stacked behavior on small screens */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24rem;
}

/* Make the visual sit in the background, aligned to the right on larger screens */
@media (min-width: 768px) {
    .hero-content {
        /* ensure main content stays above the visual */
        position: relative;
            z-index: 2;
    }

    .hero-visual {
        position: absolute;
        right: 2rem;
        top: 50%;
        transform: translateY(-50%);
        width: 45%;
        max-width: 560px;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1; /* behind the hero content but above the section background */
        pointer-events: none; /* visual shouldn't block interactions */
    }

    /* Larger screens: push visual much more to the right and reduce its width so it doesn't overlap content */
    @media (min-width: 1024px) {
        .hero-content {
            /* increase stacking to be safely above the visual */
            z-index: 3;
        }

        .hero-visual {
            /* move further outside the container to the right */
            right: -8vw;
            width: 35%;
            max-width: 720px;
            /* nudge a bit further to the right using translateX so left edge doesn't intrude */
            transform: translateY(-50%) translateX(12%);
            z-index: 0; /* behind the hero content */
            opacity: 0.95; /* slightly toned down so it reads as background */
        }
    }
}

.code-icon {
    position: relative;
    font-size: 6rem;
    font-weight: bold;
    filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.8)) drop-shadow(0 0 60px rgba(6, 182, 212, 0.6));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Sections */
section {
    padding: 5rem 0;
}

section:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.5);
}

.section-title {
    font-size: 2.25rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 42rem;
    margin: 0 auto 3rem;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
    text-align: center;
}

@media (min-width: 768px) {
    .service-card {
        text-align: left;
    }
}

.service-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Technologies Section */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tech-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.tech-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.tech-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.tech-card ul {
    list-style: none;
}

.tech-card li {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
}

.tech-card li:before {
    content: "●";
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Products Section */
.products {
    padding: 5rem 0;
    background: var(--bg-darker);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    text-align: center;
}

@media (min-width: 768px) {
    .product-card {
        text-align: left;
    }
}

.product-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(6, 182, 212, 0.15);
}

.product-card.featured {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(6, 182, 212, 0.05);
}

.product-header {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .product-header {
        justify-content: space-between;
    }
}

.product-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.product-badge {
    background: var(--primary-color);
    color: var(--bg-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.product-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.product-features li {
    color: var(--text-muted);
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.product-features li:before {
    content: "✓ ";
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-weight: bold;
}

.product-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .product-tech {
        justify-content: flex-start;
    }
}

.product-tech span {
    background: rgba(6, 182, 212, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.product-card .btn {
    margin-top: auto;
}

/* Portfolio Section */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.portfolio-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
    text-align: center;
}

@media (min-width: 768px) {
    .portfolio-card {
        text-align: left;
    }
}

.portfolio-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.portfolio-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.portfolio-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .tech-tags {
        justify-content: flex-start;
    }
}

.tech-tags span {
    background: rgba(6, 182, 212, 0.2);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* Process Section */
.process-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .process-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.process-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 0.5rem;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s;
    text-align: center;
}

@media (min-width: 768px) {
    .process-card {
        text-align: left;
    }
}

.process-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.process-number {
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 3rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--bg-dark);
}

@media (min-width: 768px) {
    .process-number {
        left: -1.5rem;
        transform: none;
    }
}
    color: var(--bg-dark);
}

.process-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

.process-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Why Us Section */
.why-us-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .why-us-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.why-us-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
    text-align: center;
}

@media (min-width: 768px) {
    .why-us-card {
        text-align: left;
    }
}

.why-us-card:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.why-us-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.why-us-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Contact Section */
.contact-form {
    max-width: 42rem;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background-color: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #6b7280;
}

.contact-form button {
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background-color: #020617;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.8);
}

/* Responsive */
@media (max-width: 640px) {
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Mobile-specific hero background + small-screen readability tweaks */
@media (max-width: 767px) {
    .hero {
        /* keep relative stacking context */
        position: relative;
        padding-top: 6.5rem; /* a bit less vertical space on small screens */
        padding-bottom: 3rem;
    }

    /* make hero content sit above the decorative visual */
    .hero-content {
        position: relative;
        z-index: 3;
    }

    /* turn the visual into a subtle background that doesn't interfere with reading */
    .hero-visual {
        position: absolute;
        inset: 0; /* cover the hero area */
        right: 0;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 120%;
        max-width: none;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1; /* behind text */
        pointer-events: none;
        opacity: 0.07; /* very subtle */
        filter: blur(3px) saturate(0.9);
    }

    /* reduce size of the visual icon on mobile so it doesn't dominate */
    .hero-visual .code-icon {
        font-size: 4rem;
        filter: drop-shadow(0 0 18px rgba(6, 182, 212, 0.6));
    }

    /* make the hero title slightly smaller for better wrapping */
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.15;
    }

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

    /* keep buttons stacked (already handled) but add spacing */
    .hero-buttons {
        gap: 0.75rem;
    }
}

/* Slightly different background behavior for small tablets -> ensure visual stays out of the way */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-visual {
        opacity: 0.18;
        right: 1rem;
        width: 48%;
        transform: translateY(-50%);
        filter: blur(1px);
        z-index: 1;
    }
}
