@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Poppins:wght@600;700;800;900&display=swap');

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Layout --- */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: var(--section-padding);
}

@media (max-width: 768px) {
    section {
        padding: var(--section-padding-mobile);
    }
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--section-bg-light);
    border-color: var(--text-dark);
}

/* Header / Navigation */
header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

nav,
.container.nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0;
    box-sizing: border-box;
    overflow: visible;
}

nav > *,
.container.nav > * {
    flex-shrink: 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    transition: var(--transition);
    border-radius: var(--radius-md);
    text-decoration: none;
    flex-shrink: 0;
    flex-grow: 0;
    width: auto;
    max-width: none;
    min-width: 0;
}

.logo:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.logo img {
    height: 45px;
    width: auto;
    max-width: 200px;
    display: block;
    transition: var(--transition);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

.logo:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(230, 46, 29, 0.2));
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    white-space: nowrap;
    width: auto;
    flex-grow: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    display: flex;
    align-items: center;
}

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

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    align-items: center;
    flex-shrink: 0;
}

#menu-toggle {
    display: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 640px) {
    .logo img {
        height: 38px;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    #menu-toggle:checked ~ label ~ .nav-links,
    #menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: block;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.footer-logo img {
    height: 40px;
    width: auto;
    display: block;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

.footer-logo:hover img {
    transform: scale(1.05);
    filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(255, 255, 255, 0.2));
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 24px;
    font-size: 1.125rem;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #94a3b8;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Social Icons */
.socials {
    display: flex;
    gap: 24px !important;
    margin-top: 24px;
    align-items: center;
}

.socials a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--white) !important;
    font-size: 1.3rem !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-decoration: none !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.socials a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary-color);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: 0;
}

.socials a:hover::before {
    width: 100%;
    height: 100%;
}

.socials a i {
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease, color 0.3s ease;
    color: var(--white);
}

.socials a:hover {
    transform: translateY(-6px) scale(1.15) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 10px 25px rgba(206, 53, 42, 0.6),
                0 5px 15px rgba(0, 0, 0, 0.3) !important;
    background-color: transparent !important;
}

.socials a:hover i {
    transform: scale(1.2) !important;
    color: var(--white) !important;
}

.socials a:active {
    transform: translateY(-3px) scale(1.1) !important;
}

/* Utils */
.text-center { text-align: center; }
.bg-light { background-color: var(--section-bg-light); }

/* --- Specific Section Styles --- */

/* Hero */
.hero {
    display: flex;
    align-items: center;
    gap: 60px;
    padding-top: 100px;
    padding-bottom: 100px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 40px;
    max-width: 550px;
}

.hero-btns {
    display: flex;
    gap: 16px;
}

.hero-image {
    flex: 1;
}

@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 60px;
        padding-bottom: 60px;
    }
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-btns {
        justify-content: center;
    }
}

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

/* Service Cards */
.card {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card .icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    display: block;
    color: var(--primary-color);
}

.card .icon i {
    display: inline-block;
    transition: var(--transition);
}

.card:hover .icon i {
    transform: scale(1.1);
}

.card h3 {
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-light);
}

/* Features List */
.features-list li {
    margin-bottom: 30px;
}

.features-list li strong {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

/* Tech Stack Section */
.tech-stack-section {
    position: relative;
    overflow: hidden;
}

.tech-stack-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(206, 53, 42, 0.03) 0%, rgba(15, 23, 42, 0.02) 100%);
    pointer-events: none;
}

.tech-stack-section .container {
    position: relative;
    z-index: 1;
}

/* Tech Grid */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.tech-card {
    flex: 0 0 auto;
    width: 140px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 140px;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(206, 53, 42, 0.1), transparent);
    transition: left 0.5s ease;
}

.tech-card:hover::before {
    left: 100%;
}

.tech-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 12px 32px rgba(206, 53, 42, 0.15),
                0 4px 16px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--white) 0%, #fff5f5 100%);
}

.tech-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(20%) opacity(0.9);
    position: relative;
    z-index: 1;
}

.tech-card:hover .tech-logo {
    transform: scale(1.15) rotate(5deg);
    filter: grayscale(0%) opacity(1);
}

/* Legacy support for old tech-badge class */
.tech-badge {
    padding: 12px 24px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition);
}

.tech-badge:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .tech-grid {
        gap: 16px;
    }
    
    .tech-card {
        width: 120px;
        padding: 32px 20px;
        min-height: 120px;
    }
    
    .tech-logo {
        width: 64px;
        height: 64px;
    }
}

/* Testimonials */
.testimonial-card {
    background-color: var(--section-bg-light);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.testimonial-card p {
    font-size: 1.125rem;
    font-style: italic;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.client-info strong {
    display: block;
    color: var(--primary-color);
}

.client-info span {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Grid helper */
.grid {
    display: grid;
    gap: 30px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
}
