:root { 
    --primary: #ffaa00; --bg: #010203; --text: #ffffff;
    --glass: rgba(255, 255, 255, 0.05); --nav-bg: rgba(1, 2, 3, 0.9);
    --grid-color: rgba(255, 255, 255, 0.03);
}

body.light-mode {
    --primary: #0044cc; --bg: #f5f2ed; --text: #1a1a1a;
    --glass: rgba(0, 0, 0, 0.03); --nav-bg: rgba(245, 242, 237, 0.9);
    --grid-color: rgba(0, 0, 0, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    background-color: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden; 
    transition: background-color 0.5s ease; 
}

body::before {
    content: ""; position: fixed; inset: 0; z-index: -2;
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* LOADER */
#loader { 
    position: fixed; inset: 0; background: var(--bg); z-index: 9999; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
#loader.hidden { opacity: 0; visibility: hidden; transform: scale(1.1); }
.loader-content { width: 300px; max-width: 80%; display: flex; flex-direction: column; gap: 15px; }
.loader-header { display: flex; justify-content: space-between; font-family: 'JetBrains Mono'; font-size: 10px; color: var(--primary); letter-spacing: 2px; }
.progress-container { height: 4px; width: 100%; background: rgba(125,125,125,0.1); position: relative; overflow: hidden; }
#progress-bar { height: 100%; width: 0%; background: var(--primary); transition: 0.1s linear; box-shadow: 0 0 15px var(--primary); }
.status-text { font-family: 'JetBrains Mono'; font-size: 9px; opacity: 0.5; text-transform: uppercase; }

/* Logo */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.header-logo {
    height: 40px; /* Adjust based on your logo aspect ratio */
    width: auto;
    display: block;
    filter: brightness(1.2); /* Makes colors pop on dark bg */
    transition: filter 0.3s ease, transform 0.3s ease;
}

.logo-container:hover .header-logo {
    transform: scale(1.05);
}

.logo-hud-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--primary);
    opacity: 0.6;
    text-transform: uppercase;
}
/* CANVAS LAYER */
#particle-canvas { position: fixed; inset: 0; z-index: -1; }
#edge-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* HEADER & NAVIGATION */
.header {
    position: fixed; top: 0; width: 100%; z-index: 1001;
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 5%; backdrop-filter: blur(20px); border-bottom: 1px solid rgba(125,125,125,0.1); background: var(--nav-bg);
}
.desktop-links { display: flex; gap: 30px; align-items: center; }
.desktop-links a { text-decoration: none; color: var(--text); font-family: 'JetBrains Mono'; font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }

.menu-toggle { display: none; flex-direction: column; gap: 6px; background: none; border: none; cursor: pointer; }
.menu-toggle span { display: block; width: 25px; height: 2px; background: var(--text); }

.mobile-nav { 
    position: fixed; top: 0; left: 0; width: 100%; height: 70vh; 
    background: var(--nav-bg); z-index: 1000; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    gap: 25px; transform: translateY(-100%); transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 2px solid var(--primary);
}
.mobile-nav.active { transform: translateY(0); }
.mobile-nav a { text-decoration: none; color: var(--text); font-family: 'JetBrains Mono'; font-size: 14px; letter-spacing: 2px; }

@media (max-width: 900px) { .desktop-links { display: none; } .menu-toggle { display: flex; } }

.hero-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--text);
    opacity: 0.8;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-left: 2px solid var(--primary);
    padding-left: 20px;
}

/* Ensure the tagline is visible even before the reveal animation triggers for better UX */
.hero-container.active .hero-tagline {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hero-tagline {
        border-left: none;
        border-top: 1px solid var(--primary);
        padding-left: 0;
        padding-top: 20px;
        margin-bottom: 30px;
    }
}

/* HERO */
.section { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 100px 8%; position: relative; z-index: 2; }
.hero-container { perspective: 1000px; text-align: center; opacity: 0; transform: translateY(30px); transition: 1.5s cubic-bezier(0.16, 1, 0.3, 1); }
.hero-container.active { opacity: 1; transform: translateY(0); }
.hero-title { font-size: clamp(2rem, 10vw, 4rem); font-weight: 900; letter-spacing: -4px; line-height: 0.85; text-transform: uppercase; margin-bottom: 40px; line-height: 1.2;}
.hero-btns { display: flex; gap: 20px; justify-content: center; align-items: center; margin-top: 20px; }

/* COMPONENTS */
.btn-glitch {
    position: relative; padding: 18px 35px; background: transparent; color: var(--text);
    font-family: 'JetBrains Mono'; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; border: 1px solid rgba(125,125,125,0.3); cursor: pointer;
    overflow: hidden; transition: 0.4s; text-decoration: none; display: inline-block;
}
.btn-glitch:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #000; border-color: var(--primary); }

.industrial-cut { 
    position: relative;
    clip-path: polygon(0 0, 85% 0, 100% 15%, 100% 100%, 15% 100%, 0 85%); 
    overflow: hidden; border: 1px solid rgba(125,125,125,0.2);
}
.hud-overlay {
    position: absolute; inset: 0; background: rgba(255,170,0,0.05);
    opacity: 0; transition: 0.4s; pointer-events: none;
    display: flex; flex-direction: column; justify-content: space-between; padding: 15px;
    font-family: 'JetBrains Mono'; font-size: 10px; color: var(--primary);
}
.hud-scanline {
    position: absolute; top: -100%; left: 0; width: 100%; height: 2px;
    background: var(--primary); box-shadow: 0 0 15px var(--primary);
    transition: 0s;
}
.industrial-cut:hover .hud-overlay { opacity: 1; }
.industrial-cut:hover .hud-scanline { top: 100%; transition: 1.5s linear; }

.img-hover img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: 1s cubic-bezier(0.16, 1, 0.3, 1); }
.img-hover:hover img { filter: grayscale(0.5); transform: scale(1.1); }

/* GRID SYSTEMS */
.architect-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: center; width: 100%; max-width: 1300px; }
.architect-img-wrap { position: relative; height: 600px; clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%); overflow: hidden; }
.architect-img-wrap img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: 2s cubic-bezier(0.16, 1, 0.3, 1); transform: scale(1.2); }
.in-view .architect-img-wrap img { transform: scale(1); filter: grayscale(0.2); }

.services-wrapper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; width: 100%; max-width: 1300px; margin-top: 50px; }
.service-card { background: var(--glass); padding: 30px; border: 1px solid rgba(125,125,125,0.1); }

.infra-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; width: 100%; max-width: 1400px; margin-top: 50px; }
.infra-card { background: var(--glass); padding: 25px; border: 1px solid rgba(125,125,125,0.1); }

/* ROADMAP */
.timeline-wrapper { position: relative; width: 100%; max-width: 1100px; margin-top: 80px; padding-left: 50px; }
.timeline-line { position: absolute; left: 15px; top: 0; bottom: 0; width: 1px; background: rgba(125,125,125,0.1); }
.timeline-progress { position: absolute; left: 15px; top: 0; width: 1px; height: 0%; background: var(--primary); transition: height 0.1s linear; }
.timeline-node { position: relative; margin-bottom: 120px; padding-left: 60px; display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.node-dot {
    position: absolute; left: -50px; top: 5px; width: 30px; height: 30px;
    background: var(--bg); border: 1px solid rgba(125,125,125,0.3);
    transform: rotate(45deg); transition: 0.6s; z-index: 5;
}
.timeline-node.in-view .node-dot { border-color: var(--primary); box-shadow: 0 0 20px rgba(255,170,0,0.2); }
.node-img-container { flex: 0 0 350px; height: 220px; opacity: 0; transform: translateX(30px); transition: 1.2s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden; }
.timeline-node.in-view .node-img-container { opacity: 1; transform: translateX(0); }
.node-img-container img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: 1s; }

/* CONTACT & LISTS */
.collab-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; max-width: 900px; margin-top: 30px; text-align: left; }
.collab-item { padding: 20px; border-left: 1px solid var(--primary); background: var(--glass); font-family: 'JetBrains Mono'; font-size: 1.0rem; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; width: 100%; max-width: 1200px; }
.contact-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

input, textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(125,125,125,0.3); padding: 15px 0; color: var(--text); outline: none; margin-bottom: 20px; font-family: 'JetBrains Mono'; font-size: 0.9rem; }
input:focus, textarea:focus { border-color: var(--primary); }
.contact-btn { background: var(--primary); color: #000; border: none; padding: 20px; font-family: 'JetBrains Mono'; font-weight: 900; cursor: pointer; width: 100%; transition: 0.4s; letter-spacing: 2px; }

/* ANIMATION UTILS */
.maze-mask { overflow: hidden; display: block; }
.maze-line { display: block; transform: translateY(110%); transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.in-view .maze-line { transform: translateY(0); }
.kinetic-reveal { opacity: 0; transform: translateY(20px); transition: 1s cubic-bezier(0.16, 1, 0.3, 1); }
.kinetic-reveal.in-view { opacity: 1; transform: translateY(0); }

/* FOOTER */
.footer { 
    padding: 60px 5%; 
    border-top: 1px solid rgba(125,125,125,0.1); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-family: 'JetBrains Mono'; 
    font-size: 10px; 
    position: relative; 
    z-index: 10; /* Ensures it sits above the canvas */
    background: var(--bg); /* Prevents particles from overlapping text */
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.footer-socials a {
    color: var(--text);
    font-size: 1.2rem;
    opacity: 0.6;
    transition: 0.3s;
    text-decoration: none;
}

.footer-socials a:hover {
    opacity: 1;
    color: var(--primary);
    transform: translateY(-3px);
}

/* Mobile Fix */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 40px 5%;
    }
}

.theme-toggle { background: none; border: 1px solid var(--primary); color: var(--primary); padding: 6px 15px; font-family: 'JetBrains Mono'; font-size: 10px; cursor: pointer; border-radius: 20px; }

/* RESPONSIVE OVERRIDES */
@media (max-width: 1100px) { .infra-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) { .services-wrapper { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { 
    .architect-grid { grid-template-columns: 1fr; } 
    .architect-img-wrap { height: 400px; clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); }
    .timeline-node { flex-direction: column; align-items: flex-start; gap: 25px; margin-bottom: 80px; }
    .node-img-container { flex: 0 0 auto; width: 100%; height: 200px; }
    .contact-grid { grid-template-columns: 1fr; gap: 50px; }
}
@media (max-width: 650px) { .services-wrapper { grid-template-columns: 1fr; } .contact-inputs { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .infra-grid, .collab-list { grid-template-columns: 1fr; } }

.dev-container {
    width: 100%;
    max-width: 1100px;
}

.dev-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.dev-list-box {
    background: var(--glass);
    padding: 30px;
    border-left: 2px solid var(--primary);
    position: relative;
}

.dev-list-label {
    display: block;
    font-family: 'JetBrains Mono';
    font-size: 10px;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.dev-list-box ul {
    list-style: none;
}

.dev-list-box ul li {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 12px;
    opacity: 0.8;
    position: relative;
    padding-left: 20px;
}

.dev-list-box ul li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--primary);
}

@media (max-width: 850px) {
    .dev-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.footer-socials {
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: center;
}

.footer-socials a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.footer-socials a:hover {
    opacity: 1;
    color: var(--primary);
    transform: translateY(-3px);
    text-shadow: 0 0 10px var(--primary);
}

/* Subtle HUD indicator for social links */
.footer-socials a::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: 0.3s;
    transform: translateX(-50%);
}

.footer-socials a:hover::after {
    width: 100%;
}

@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .footer-socials {
        order: 2; /* Keeps socials in the middle on mobile */
    }
}

/* =========================================
   CONTACT FORM - CONSOLIDATED & FIXED
   ========================================= */

/* 1. ISOLATE & LAYOUT */
.form-side { position: relative; z-index: 10; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 100px; align-items: flex-start; width: 100%; max-width: 1200px; }
.contact-card { background: rgba(1, 2, 3, 0.8); backdrop-filter: blur(15px); border: 1px solid rgba(255, 170, 0, 0.15); padding: 40px; position: relative; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }

/* 2. HUD HEADER */
.contact-header { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-family: 'JetBrains Mono'; font-size: 10px; letter-spacing: 2px; color: var(--primary); opacity: 0.8; }
.status-dot { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.4; box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.4); } 70% { opacity: 1; box-shadow: 0 0 0 10px rgba(255, 170, 0, 0); } 100% { opacity: 0.4; } }

/* 3. FORM FIELDS */
.cyber-form { display: flex; flex-direction: column; gap: 25px; }
.contact-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.form-group { position: relative; width: 100%; margin: 0; }

/* Overriding old margins that broke the layout */
.form-group input, .form-group textarea { 
    width: 100%; 
    background: rgba(255, 255, 255, 0.03); 
    border: none; 
    border-bottom: 1px solid rgba(125, 125, 125, 0.3); 
    padding: 15px 12px; 
    color: var(--text); 
    font-family: 'JetBrains Mono'; 
    font-size: 0.9rem; 
    outline: none; 
    transition: background 0.3s; 
    margin: 0 !important; /* Forces the animated line to stick to the bottom */
}
.form-group textarea { resize: none; min-height: 120px; }

/* 4. FLOATING LABELS */
.form-group label { position: absolute; left: 12px; top: 15px; font-size: 0.75rem; font-family: 'JetBrains Mono'; color: var(--text); opacity: 0.5; pointer-events: none; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); text-transform: uppercase; letter-spacing: 1.5px; }
.form-group input:focus ~ label, .form-group input:not(:placeholder-shown) ~ label, .form-group textarea:focus ~ label, .form-group textarea:not(:placeholder-shown) ~ label { top: -12px; left: 0; font-size: 0.6rem; opacity: 1; color: var(--primary); }

/* 5. ANIMATED LINE */
.form-group .line { position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--primary); box-shadow: 0 0 10px var(--primary); transition: width 0.5s ease; }
.form-group input:focus ~ .line, .form-group textarea:focus ~ .line { width: 100%; }

/* 6. BUTTON */
.contact-btn { width: 100%; background: var(--primary); color: #000; padding: 20px; font-family: 'JetBrains Mono'; font-weight: 900; border: none; cursor: pointer; transition: 0.3s; letter-spacing: 2px; position: relative; overflow: hidden; margin-top: 10px;}
.contact-btn:hover { letter-spacing: 4px; box-shadow: 0 0 30px rgba(255, 170, 0, 0.3); }

/* 7. SUCCESS STATE (Triggered by JS) */
.contact-btn.sent, .contact-btn.success { background: #00ff88 !important; color: #000 !important; box-shadow: 0 0 30px rgba(0, 255, 136, 0.4); pointer-events: none; }
.contact-btn.sent .btn-text, .contact-btn.success .btn-text { animation: pulse-green 1s infinite; }
@keyframes pulse-green { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }

/* 8. MOBILE RESPONSIVENESS */
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 50px; } .contact-card { padding: 30px 20px; } }
@media (max-width: 650px) { .contact-inputs { grid-template-columns: 1fr; gap: 30px; } }

@media (max-width: 768px) {
    .hero-title {
        /* Reduce the negative spacing so letters don't overlap */
        letter-spacing: -1px; 
        
        /* Optional: slightly reduce the font size further if the long word pushes off-screen */
        font-size: clamp(2rem, 8vw, 3rem); 
        
        /* Ensures long words don't break the layout horizontally */
        word-wrap: break-word; 
    }
}

/* LOGO & TEXT ALIGNMENT */
.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.company-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    line-height: 1.1;
}

.company-name .cotswold {
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 2px;
}

.company-name .cleantech {
    font-size: 9px;
    color: var(--primary); /* Highlights the 'Cleantech Energy' part in your orange/blue */
    letter-spacing: 1px;
    opacity: 0.9;
}

/* MOBILE RESPONSIVENESS FOR THE LOGO */
@media (max-width: 768px) {
    .logo-link {
        gap: 8px; /* Brings text closer to the image */
    }
    
    .header-logo {
        height: 32px; /* Slightly shrinks the image */
    }

    .company-name .cotswold {
        font-size: 12px;
    }

    .company-name .cleantech {
        font-size: 7.5px;
    }
}

@media (max-width: 380px) {
    /* For extra small phones, prevent overlapping with the menu button */
    .company-name {
        display: none; /* Hides the text, leaving just the emerald 'C' logo */
    }
}