:root {
    /* "Chemical Architecture" Palette */
    --bg-dark: #050505;
    --bg-panel: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;

    --accent-primary: #06b6d4;
    /* Chem Cyan */
    --accent-secondary: #3b82f6;
    /* Lab Blue */
    --accent-gold: #f59e0b;
    /* Safety Gold */

    --font-heading: 'Syne', 'Noto Nastaliq Urdu', sans-serif;
    --font-body: 'Inter', 'Noto Nastaliq Urdu', sans-serif;
    --font-urdu: 'Noto Nastaliq Urdu', serif;

    --easing: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor for custom one */
}

/* Custom Cursor */
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease-out;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    direction: rtl;
    /* RTL Layout */
    overflow-x: hidden;
}

/* Typography Overrides for Urdu */
h1,
h2,
h3,
.urdu-font,
.nav-link span,
.hero-desc,
p {
    font-family: var(--font-urdu);
    line-height: 2.3;
    /* Increased line height for Nastaliq */
}

.en-font,
.brand-symbol,
.brand-text .en,
.counter,
.p-number {
    font-family: 'Syne', sans-serif;
    direction: ltr;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s var(--easing);
}

body.loaded .loader {
    transform: translateY(-100%);
}

.loader-track {
    width: 200px;
    height: 1px;
    background: #333;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.loader-bar {
    position: absolute;
    height: 100%;
    width: 100%;
    background: var(--accent-primary);
    transform: translateX(-100%);
    animation: loadProgress 1.5s var(--easing) forwards;
}

.loader-text {
    font-family: 'Syne', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #555;
}

@keyframes loadProgress {
    to {
        transform: translateX(0);
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    transition: all 0.4s var(--easing);
    mix-blend-mode: difference;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-symbol {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-text .en {
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.brand-text .ur {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.nav-menu {
    display: flex;
    gap: 3rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.nav-link span {
    font-family: 'Syne';
    font-size: 0.8rem;
    color: var(--accent-primary);
    opacity: 0.5;
}

.nav-link:hover {
    color: white;
}

.cta-button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-urdu);
    transition: all 0.3s;
}

.cta-button:hover {
    background: white;
    color: black;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    padding-top: 15vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -20%;
    right: -10%;
    animation: floatOrb 10s infinite alternate;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: 10%;
    left: 10%;
    animation: floatOrb 12s infinite alternate-reverse;
}

@keyframes floatOrb {
    to {
        transform: translate(30px, 30px);
    }
}

.hero-text-wrapper {
    max-width: 900px;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;

    /* High Contrast Box */
    background: rgba(0, 0, 0, 0.75);
    /* Much darker for guaranteed readability */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 3.5rem;
    /* More padding */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 12px #10b981;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.8;
    /* Increased to prevent clipping in overflow:hidden containers */
    font-weight: 800;
    margin-bottom: 2rem;
    color: #ffffff;
    /* Simple, strong drop shadow instead of glow */
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.reveal-text-container {
    overflow: hidden;
    line-height: 1.8;
    /* MATCHES hero-title line-height to prevent clipping */
    padding-bottom: 0.5rem;
    /* Extra space for descenders */
    padding-top: 0.5rem;
    /* Extra space for ascenders */
}

.outline-text {
    color: #ffffff;
    text-shadow: inherit;
    -webkit-text-stroke: 0;
    /* Remove stroke completely */
}

.highlight-text {
    color: var(--accent-primary);
    position: relative;
    display: inline-block;
    text-shadow: none;
    /* Removed blur/glow for sharpness */
}

.hero-desc {
    font-size: 1.8rem;
    /* Even larger */
    color: #ffffff;
    /* Pure white */
    max-width: 100%;
    margin-bottom: 3rem;
    line-height: 2.4;
    /* Very generous spacing */
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.primary-btn,
.secondary-btn {
    padding: 1rem 2.5rem;
    border-radius: 100px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s var(--easing);
}

.primary-btn {
    background: var(--text-primary);
    color: black;
    font-weight: 600;
}

.primary-btn:hover {
    transform: scale(1.05);
}

.secondary-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hero-stats-strip {
    display: flex;
    gap: 4rem;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.stat-box {
    text-align: right;
}

.stat-box .counter {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    line-height: 1;
    color: var(--text-primary);
}

.stat-box .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-urdu);
}

.divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

/* Marquee */
.marquee-strip {
    background: var(--accent-primary);
    color: black;
    padding: 1.5rem 0;
    transform: rotate(-1deg);
    overflow: hidden;
    margin: 4rem 0;
}

.marquee-content {
    display: flex;
    gap: 4rem;
    white-space: nowrap;
    animation: scroll 20s linear infinite;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    align-items: center;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }

    /* RTL Scroll: Move Right */
}

/* Services (Bento Grid) */
.services-section {
    padding: 8rem 0;
}

.section-head {
    margin-bottom: 5rem;
}

.sub-head {
    font-family: 'Syne';
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.section-head h2 {
    font-size: 3.5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
}

.bento-card {
    background: #0f0f0f;
    border: 1px solid #1f1f1f;
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--easing);
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.x-large {
    grid-column: span 2;
    background: linear-gradient(135deg, #0f0f0f 0%, #161616 100%);
}

.wide {
    grid-column: span 3;
    flex-direction: row;
    align-items: center;
}

.icon-circle {
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    transition: 0.4s;
}

.bento-card:hover .icon-circle {
    background: var(--accent-primary);
    color: black;
}

.bento-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.bento-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Process */
.process-section {
    padding: 6rem 0;
    background: #080808;
    border-top: 1px solid #1f1f1f;
    border-bottom: 1px solid #1f1f1f;
}

.process-timeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 4rem;
}

.process-item {
    padding: 0 2rem;
    border-left: 1px solid #1f1f1f;
    /* RTL left border */
}

.process-item:last-child {
    border-left: none;
}

.p-number {
    font-size: 4rem;
    color: #1f1f1f;
    font-weight: 800;
    margin-bottom: 1rem;
    transition: 0.3s;
}

.process-item:hover .p-number {
    color: var(--accent-primary);
}

/* Contact */
.contact-section {
    padding: 8rem 0;
}

.contact-card {
    background: #0a0a0a;
    border-radius: 40px;
    padding: 5rem;
    border: 1px solid #1f1f1f;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
}

.contact-text h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-details {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.detail-row i {
    color: var(--accent-primary);
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-urdu);
    transition: 0.3s;
    resize: none;
    /* Prevent manual resize */
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
}

.input-group label {
    position: absolute;
    top: 1rem;
    right: 0;
    color: #555;
    pointer-events: none;
    transition: 0.3s;
    font-size: 1.1rem;
}

.input-group input:focus~label,
.input-group input:valid~label,
.input-group textarea:focus~label,
.input-group textarea:valid~label {
    top: -1.2rem;
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.submit-btn {
    width: 100%;
    padding: 1.5rem;
    background: var(--accent-primary);
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    transition: 0.3s;
}

.submit-btn:hover {
    background: white;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .nav-menu {
        display: none;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-stats-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .divider {
        display: none;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .x-large,
    .wide {
        grid-column: span 1;
    }

    .process-timeline {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .process-item {
        border-left: none;
        border-bottom: 1px solid #1f1f1f;
        padding-bottom: 2rem;
    }

    .contact-card {
        padding: 2rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Logo Styling */
.nav-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    /* If the logo has a white background, we need to handle it. 
       Since the site is dark mode, a white box looks jarring. 
       We will use a subtle filter to brighten it if it's transparent, 
       or a styled container if it's opaque. 
       Assuming it might have a white background based on the user upload: */
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 10px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.footer-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
}

/* Adjust nav container to accommodate logo */
.brand {
    display: flex;
    align-items: center;
}

/* Real Image Hero Background */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;

    /* Premium Water Protection Image */
    background-image: url('https://images.unsplash.com/photo-1516156008625-3a9d60da923c?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */

    /* Cinematic Overlay */
    background: linear-gradient(to bottom,
            rgba(5, 5, 5, 0.7),
            rgba(6, 182, 212, 0.1),
            rgba(5, 5, 5, 0.9)), url('https://images.unsplash.com/photo-1516156008625-3a9d60da923c?q=80&w=1920&auto=format&fit=crop');

    background-size: cover;
    background-position: center;
    filter: contrast(1.15) saturate(1.1);
}

/* Hide the abstract orbs since we have a real image now */
.gradient-orb {
    display: none;
}

/* Text Reveal Animation */
/* Text Reveal Animation - cleaned up duplicate */
.reveal-text {
    transform: translateY(100%) rotate(5deg);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s cubic-bezier(0.19, 1, 0.22, 1);
    display: block;
}

.is-visible .reveal-text {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

/* Staggered Grid Reveal */
.bento-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.bento-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* 3D Tilt Effect Preserve */
.bento-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-content {
    transform: translateZ(20px);
}

/* Shine Effect */
.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transition: 0.5s;
    z-index: 10;
    pointer-events: none;
}

.bento-card:hover::before {
    left: 100%;
    transition: 0.5s;
}