/* 
  EMSAR Solutions
  Design System & Main Styles
  MH Mode: Refined for multi-section services and contact hub
*/

:root {
    /* Color Palette */
    --primary: #0A0A0A;
    --secondary: #2563EB;
    /* Cobalt Blue */
    --accent: #10B981;
    /* Emerald Green */
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --card-bg: rgba(23, 23, 23, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);

    /* Spacing */
    --container-max: 1280px;
    --section-padding: 140px 20px;

    /* Animation */
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

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

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    line-height: 1.1;
}

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

ul {
    list-style: none;
}

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

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

.text-center {
    text-align: center;
}

/* Typography Utilities */
.text-gradient {
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--secondary);
    border-radius: 50px;
    font-size: 3rem;
    /* Increased size */
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--secondary);
    color: #fff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

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

.btn-outline:hover {
    background: var(--border);
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    background: transparent;
}

#navbar.scrolled {
    background: #FFFFFF;
    padding: 12px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#navbar nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    /* White logo by default */
    transition: filter 0.3s ease;
}

#navbar.scrolled .nav-logo {
    filter: none;
    /* Original Blue logo when scrolled */
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links li a {
    font-weight: 500;
    font-size: 0.95rem;
    color: #FFFFFF;
    /* White links by default */
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-links li a {
    color: #1A2567;
    /* Blue links when scrolled */
}

.nav-links li a:hover {
    color: var(--secondary);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(transparent, var(--primary));
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    /* Slightly smaller */
    margin-bottom: 24px;
}

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

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

/* Service Intro Section */
.service-intro-section {
    padding: 100px 20px 60px;
    background: var(--primary);
}

.section-title {
    font-size: 1.5rem;
    /* Smaller than badge */
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 60px;
}

/* Service Sections */
.service-section {
    padding: var(--section-padding);
}

.alt-bg {
    background: #0D0D0D;
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
}

.service-grid.reverse .service-content {
    order: 2;
}

.service-grid.reverse .service-image {
    order: 1;
}

.service-content h2 {
    font-size: 1.25rem;
    /* Smaller than badge */
    margin-bottom: 24px;
}

.service-content p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.feature-list {
    margin-bottom: 40px;
}

.feature-list li {
    margin-bottom: 20px;
    position: relative;
    padding-left: 30px;
}

.feature-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: 800;
}

.service-image {
    position: relative;
}

.glass-container {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 40px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.abstract-icon {
    width: 50%;
    color: var(--secondary);
    opacity: 0.5;
    transition: stroke 0.8s ease, opacity 0.8s ease;
}

/* Security Icon Animation */
#security-icon.open-state {
    stroke: #ff4d4d;
    opacity: 1;
}

#security-icon.open-state .shackle {
    transform: translateY(-4px) translateX(3px) rotate(20deg);
}

#security-icon .shackle {
    transform-origin: 7px 11px;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.accounting-visual img {
    border-radius: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.projects-section .section-header h2 {
    margin-bottom: 60px;
    /* Added margin since p was removed */
    font-size: 1.5rem;
}

/* Projects Section */
.projects-section {
    padding: var(--section-padding);
    background: #000000;
}

.projects-slider {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding-bottom: 40px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
}

.projects-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.project-card {
    min-width: 450px;
    /* Standardize Desktop Width */
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    scroll-snap-align: center;
    border: 1px solid var(--border);
    position: relative;
}

.project-image {
    position: relative;
    height: 450px;
    /* Increased Height */
    overflow: hidden;
}

.blur-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.1);
    /* Prevent blur edges */
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.project-overlay h3 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.coming-soon {
    background: var(--secondary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* About Section */
.about {
    padding: var(--section-padding);
    background: linear-gradient(to bottom, var(--primary), #111);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-content h2 {
    font-size: 1.25rem;
    /* Smaller than badge */
    margin-bottom: 24px;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.about-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-orb {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.2), transparent);
    border-radius: 50%;
    filter: blur(40px);
    animation: float 6s infinite alternate;
}

.tech-stack-preview {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.tech-stack-preview span {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    font-weight: 600;
}

/* Contact Section */
.contact-section {
    padding: var(--section-padding);
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 80px;
    border-radius: 40px;
    backdrop-filter: blur(20px);
}

.contact-info-grid {
    display: grid;
    gap: 60px;
}

.contact-header h2 {
    font-size: 1.5rem;
    /* Smaller than badge */
    margin-bottom: 16px;
}

.contact-header p {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.detail-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.detail-icon {
    font-size: 1.5rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--secondary);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.detail-item h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.detail-item p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 80px 20px 40px;
    border-top: 1px solid var(--border);
}

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

.footer-info p {
    margin-top: 20px;
    color: var(--text-muted);
    max-width: 300px;
}

.footer-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer h4 {
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.social-icon:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: translateY(-5px);
}

.footer-contact p {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

/* Animations */
@keyframes float {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-20px);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

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

.reveal-delay-1 {
    transition-delay: 0.2s;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

.reveal-delay-2 {
    transition-delay: 0.4s;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-smooth);
}

.reveal-delay-1.active,
.reveal-delay-2.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--primary);
        padding: 100px 40px;
        transition: right 0.4s var(--transition-smooth);
        z-index: 999;
    }

    .nav-links.mobile-active {
        right: 0;
    }

    .mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 1001;
    }

    .mobile-toggle span {
        display: block;
        width: 30px;
        height: 2px;
        background: #FFFFFF;
        transition: 0.3s;
    }

    #navbar.scrolled .mobile-toggle span {
        background: #1A2567 !important;
        /* Force Blue on white header for visibility */
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links li a {
        color: #FFFFFF !important;
        /* Always white on mobile drawer */
        font-size: 1.5rem;
        /* Larger touch targets */
        margin-bottom: 20px;
        display: block;
    }

    .no-scroll {
        overflow: hidden;
    }

    .project-card {
        min-width: 350px;
        /* Mobile Width */
    }

    .section-title {
        font-size: 2rem;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .service-grid.reverse .service-content {
        order: 1;
    }

    .service-grid.reverse .service-image {
        order: 2;
    }

    .service-content h2,
    .about-content h2,
    .contact-header h2 {
        font-size: 2.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-card {
        padding: 40px 20px;
    }

    .badge {
        font-size: 1.5rem;
        /* Smaller on mobile */
    }
}