/* --- Quintessentia AI - Hybrid Visual Identity --- */

/* --- 1. Global Styles & Variables --- */
:root {
    --primary-color: #0A1931;      /* Deep Midnight Blue */
    --secondary-color: #3D3D3D;    /* Charcoal Grey */
    --accent-color: #00C896;       /* Electric Teal */
    --neutral-color: #F5F5F5;      /* Off-White */
    --white-color: #FFFFFF;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Lato', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-secondary);
    background-color: var(--white-color);
    color: var(--secondary-color);
    line-height: 1.7;
}

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

h1, h2, h3, h4 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--primary-color);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

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

section {
    padding: 6rem 0;
}

/* --- 2. Header --- */
header {
    background-color: var(--white-color);
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 2.5rem;
}

nav ul li a {
    color: var(--secondary-color);
    font-weight: 700;
    font-family: var(--font-primary);
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-color);
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white-color);
    padding: 0.8rem 1.8rem;
    font-family: var(--font-primary);
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: #00a078;
    transform: translateY(-2px);
}

/* --- 3. Hero Section --- */
.hero {
    background-color: var(--neutral-color);
    text-align: center;
    padding: 8rem 0;
    position: relative;
    overflow: hidden; /* To contain the pseudo-element */
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 200, 150, 0.05), transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: var(--secondary-color);
}

.home-section {
    padding: 4rem 0;
    text-align: center;
}

.home-section h2 {
    margin-bottom: 1rem;
}

.home-section .section-intro {
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

.about-section-home {
    background-color: var(--primary-color);
    color: var(--neutral-color);
}

.about-section-home h2,
.about-section-home .section-intro {
    color: var(--white-color);
}

.cta-button-outline {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-color);
    padding: 0.8rem 1.8rem;
    font-family: var(--font-primary);
    font-weight: 700;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.cta-button-outline:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

.about-section-home .cta-button-outline {
    color: var(--white-color);
    border-color: var(--white-color);
}

.about-section-home .cta-button-outline:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}

.page-header-section {
    padding: 6rem 0;
    text-align: center;
    background-color: var(--neutral-color);
}

.page-header-section h1 {
    margin-bottom: 1rem;
}

/* --- 4. Services Section --- */
.services-section {
    background-color: var(--white-color);
}

.services-section h2 {
    margin-bottom: 4rem;
}

.service-block {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 5rem;
}

.service-block:last-child {
    margin-bottom: 0;
}

.service-image-placeholder {
    flex: 1;
    min-height: 300px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-color);
    font-size: 1.5rem;
    font-family: var(--font-primary);
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background-color: var(--primary-color);
}

/* --- Unique placeholder visuals --- */
/* iOS */
.services-section .service-block:nth-of-type(1) .service-image-placeholder {
    background: radial-gradient(circle, var(--accent-color) 0%, var(--primary-color) 80%);
}

/* Android */
.services-section .service-block:nth-of-type(2) .service-image-placeholder::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    border-radius: 45%;
    opacity: 0.15;
    transform: rotate(30deg);
}
.services-section .service-block:nth-of-type(2) .service-image-placeholder::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    opacity: 0.2;
}

/* Flutter */
.services-section .service-block:nth-of-type(3) .service-image-placeholder {
    background:
        linear-gradient(30deg, var(--accent-color) -50%, transparent 50%),
        linear-gradient(-30deg, #00a078 -50%, transparent 50%);
    background-color: var(--primary-color);
}

/* AI Integration */
.services-section .service-block:nth-of-type(4) .service-image-placeholder {
    background:
        linear-gradient(rgba(0, 200, 150, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 150, 0.15) 1px, transparent 1px);
    background-size: 25px 25px;
    background-color: var(--primary-color);
}

.service-content {
    flex: 1;
}

.service-content h3 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Modifier for alternating layout */
.service-block--reverse {
    flex-direction: row-reverse;
}

/* --- 5. Tech Section --- */
.tech-section {
    background-color: var(--neutral-color);
}

.tech-category {
    margin-bottom: 3rem;
    padding: 2.5rem;
    background-color: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
}

.tech-category:last-child {
    margin-bottom: 0;
}

.tech-category h4 {
    text-align: center;
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.tech-category h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.tech-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3.5rem;
    flex-wrap: wrap;
}

.tech-logos img {
    height: 50px;
    max-width: 160px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.tech-logos img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.tech-logos img.visible {
    animation: logo-pop-animation 0.5s ease-out forwards;
}

@keyframes logo-pop-animation {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- 6. About Section --- */
.about-section {
    background-color: var(--primary-color);
    color: var(--neutral-color);
    text-align: center;
    position: relative;
    z-index: 1;
}

.about-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.03) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.03) 75%, transparent 75%, transparent);
    background-size: 50px 50px;
    z-index: -1;
    opacity: 0.5;
}

.about-section .container {
    position: relative;
    z-index: 2;
}

.about-section h2 {
    color: var(--white-color);
}
.about-section p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

.about-details {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: left;
}

.about-details h3 {
    color: var(--white-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-top: 0;
}

/* --- 7. Contact Section --- */
.contact-section {
    background-color: var(--neutral-color);
    text-align: center;
}

.contact-section .container {
    max-width: 800px;
}

.contact-section h2 {
    font-size: 2.8rem;
    line-height: 1.3;
    margin-bottom: 2.5rem;
}

.contact-section .cta-button {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    transform: scale(1);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.contact-section .cta-button:hover {
    transform: scale(1.05);
}

.contact-form {
    margin-top: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    background-color: var(--white-color);
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

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

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 200, 150, 0.3);
}

.contact-form button {
    width: 100%;
    border: none;
    cursor: pointer;
}


/* --- 8. Footer --- */
footer {
    background-color: var(--primary-color);
    color: var(--neutral-color);
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-col {
    flex: 1;
    padding: 0 1rem;
}

.footer-col h3, .footer-col h4 {
    color: var(--white-color);
    font-family: var(--font-primary);
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a, .footer-col p {
    color: var(--neutral-color);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-col ul li a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    opacity: 0.7;
}

/* --- 9. Animations --- */
body.is-leaving {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

main {
    opacity: 0;
    animation: page-load-transition 0.6s ease-out forwards;
}

@keyframes page-load-transition {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-element {
    opacity: 0;
    will-change: transform, opacity;
}

.fade-in-element.visible {
    animation: bubble-pop-animation 0.5s ease-out forwards;
}

@keyframes bubble-pop-animation {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* --- 10. Responsive Design --- */

/* Tablets and smaller desktops */
@media (max-width: 992px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.2rem; }

    .service-block,
    .service-block--reverse {
        flex-direction: column;
        text-align: center;
    }

    .service-image-placeholder {
        min-height: 250px;
        width: 100%;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    section {
        padding: 4rem 0;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    header nav ul {
        padding: 0;
        justify-content: center;
    }

    header nav ul li {
        margin: 0 1rem;
    }
    
    .header-cta {
        display: none; /* Hide header CTA on mobile to save space */
    }

    .service-block {
        gap: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
}