/* Variables */
:root {
    --primary-color: #0072C6;
    --primary-dark: #005a9e;
    --secondary-color: #333333;
    --accent-color: #f4f6f8;
    --text-color: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --container-width: 1200px;
    --header-height: 70px;
    --section-padding: 80px 0;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

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

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

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

.text-accent {
    color: var(--primary-color);
}

.bg-light {
    background-color: var(--accent-color);
}

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

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

.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

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

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

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

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

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

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 2000;
}

.skip-link:focus {
    top: 0;
}

/* Header */
.site-header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--secondary-color);
}

.logo .accent {
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

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

.nav-link.btn {
    padding: 8px 20px;
    color: var(--white);
}

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
}

/* Hero Section */
.hero {
    height: calc(100vh - var(--header-height));
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.feature-list {
    margin-top: 20px;
}

.feature-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.feature-list .icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    color: var(--primary-color);
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.about-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-top: 4px solid transparent;
}

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

.service-icon {
    margin-bottom: 20px;
    color: var(--primary-color);
}

/* Projects Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    /* Fix for corner flicker during scale/transform */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    backface-visibility: hidden;
    transform: translateZ(0);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05);
    /* Zoom effect */
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    color: var(--white);
    opacity: 0;
    transition: var(--transition);
    transform: translateY(20px);
}

.gallery-item:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Testimonials Section */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

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

.testimonial-card footer cite {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    font-style: normal;
}

/* Contact Section */
.contact-section {
    background-color: var(--white);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.info-item .icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.map-container {
    margin-top: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.contact-form {
    background: var(--accent-color);
    padding: 40px;
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 114, 198, 0.1);
}

.form-message {
    margin-top: 15px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    color: #2ecc71;
}

.form-message.error {
    color: #e74c3c;
}

/* Footer */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.site-footer h3,
.site-footer h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: var(--white);
    opacity: 0.8;
}

.social-links a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    background-color: #243342;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

#modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --section-padding: 50px 0;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    /* Mobile Hero Typography Fix */
    .hero-title {
        font-size: 2.2rem;
        /* Reduced from 3.5rem */
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 30px;
        padding: 0 10px;
        /* Prevent text touching edges */
    }

    .hero-content {
        padding: 0 15px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow-md);
        padding: 20px;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
    }

    .main-nav.active {
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 20px;
        text-align: center;
    }

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        /* Better spacing for buttons */
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    display: none;
    /* Hidden by default, shown on hover devices */
}

@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
        /* Hide default cursor */
    }

    .cursor-dot,
    .cursor-outline {
        display: block;
    }

    .cursor-dot {
        width: 8px;
        height: 8px;
        background-color: var(--primary-color);
    }

    .cursor-outline {
        width: 40px;
        height: 40px;
        border: 2px solid rgba(0, 114, 198, 0.5);
        transition: width 0.2s, height 0.2s, background-color 0.2s;
    }

    /* Hover State */
    body.hovering .cursor-outline {
        width: 60px;
        height: 60px;
        background-color: rgba(0, 114, 198, 0.1);
        border-color: var(--primary-color);
    }

    /* Active/Click State */
    body.clicking .cursor-outline {
        width: 30px;
        height: 30px;
        background-color: rgba(0, 114, 198, 0.3);
    }
}

/* WhatsApp Button */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.whatsapp-btn svg {
    width: 36px;
    height: 36px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .whatsapp-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .whatsapp-btn svg {
        width: 30px;
        height: 30px;
    }
}

/* --- Animations & Effects --- */

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transition: all 0.8s ease-out;
    will-change: opacity, transform;
}

.reveal-up {
    transform: translateY(30px);
}

.reveal-left {
    transform: translateX(-30px);
}

.reveal-right {
    transform: translateX(30px);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0);
}

/* Floating Shapes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
    /* Subtle */
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    top: 20%;
    left: 10%;
    width: 150px;
    height: 150px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation-delay: 0s;
}

.shape-2 {
    bottom: 30%;
    right: 15%;
    width: 100px;
    height: 100px;
    border: 15px solid var(--secondary-color);
    border-radius: 20px;
    animation-delay: -5s;
}

.shape-3 {
    top: 60%;
    left: 40%;
    width: 80px;
    height: 80px;
    background-color: var(--text-light);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation-delay: -10s;
    opacity: 0.05;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(20px, -40px) rotate(10deg);
    }

    66% {
        transform: translate(-15px, 20px) rotate(-5deg);
    }
}

/* Hero Parallax & Typing */
.hero-title,
.hero-subtitle {
    position: relative;
    z-index: 2;
}

/* Enhanced Hover Effects */
.service-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-top-color 0.3s ease;
}

/* Fix for Project Tilt + Zoom Conflict */
.gallery-item.tilt-card {
    /* Keep overflow hidden for zoom, use flat transform style to prevent clipping issues */
    overflow: hidden;
    transform-style: flat;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00c6ff);
    width: 0%;
    transition: width 0.1s;
    box-shadow: 0 0 10px rgba(0, 114, 198, 0.5);
}

/* 2. 3D Tilt Effect for Cards */
.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s ease;
    will-change: transform;
}

.tilt-content {
    transform: translateZ(20px);
    /* Pop out effect */
}

/* 3. Button Glow Effect */
.btn-glow {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-glow:hover::before {
    left: 100%;
    animation: glow-sweep 1.5s infinite linear;
}

@keyframes glow-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Magnetic/Hover Lift for Buttons */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 114, 198, 0.3);
}

/* --- Creative Redesign Overhaul --- */

/* 1. Global Creative Enhancements */
body {
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 0% 0%, rgba(0, 114, 198, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 198, 255, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* 2. Glassmorphism Service Cards */
.service-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 15px rgba(0, 0, 0, 0.1);
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    box-shadow:
        0 10px 20px rgba(0, 114, 198, 0.15),
        0 6px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px) scale(1.02);
}

/* 3. Creative Masonry-style Project Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    grid-auto-flow: dense;
    /* Helps fill gaps */
}

/* Make the first item span 2 columns and 2 rows for interest (desktop only) */
@media (min-width: 768px) {
    .gallery-item:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }
}

.gallery-item {
    border-radius: 15px;
    /* Softer corners */
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Ensure fix is applied here too if overridden */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.gallery-item img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.project-overlay {
    background: linear-gradient(to top, rgba(0, 60, 100, 0.9), rgba(0, 60, 100, 0));
    backdrop-filter: blur(2px);
}