:root {
    --bg: #0a0f1e;
    --text: #E0E0E0;
    --sub: #999999;
    --accent-glow: #00d8ff;
    --chip-bg: rgba(20, 28, 58, 0.7);
    --chip-edge: rgba(46, 178, 222, 0.6);
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Colors from layers.html for diagram */
    --datasrc: #2563eb;
    --sens: #0ea5e9;
    --reason: #22d3ee;
    --orch: #a78bfa;
    --chat: #f59e0b;
    --outcome: #10b981;
    --flow: #444;
    --flow-signal: var(--accent-glow);
}

/* General Body Styling */
body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    scroll-behavior: smooth;
    /* This hides the scrollbar but allows scrolling */
    -ms-overflow-style: none; /* for Internet Explorer, Edge */
    scrollbar-width: none; /* for Firefox */
    /* NEW: Hide horizontal overflow to prevent stray scrollbars */
    overflow-x: hidden;
}
/* New CSS to hide the scrollbar for WebKit browsers (Chrome, Safari) */
body::-webkit-scrollbar {
    display: none;
}
/* NEW: Apply scrollbar hiding to the root html element as well for broader compatibility */
html {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: hidden;
}
html::-webkit-scrollbar {
    display: none;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Set canvas to the base layer */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.header {
    background-color: rgba(10, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 5%;
    box-shadow: 0 2px 8px rgba(0, 216, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--chip-edge);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
}

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; }
.nav a { text-decoration: none; color: var(--text); font-weight: 500; transition: color 0.3s ease; }
.nav a:hover { color: var(--accent-glow); }

/* --- FIX FOR LAYERING ISSUE --- */
/* This ensures the entire hero section has a stacking context above the background canvas. */
.hero {
    background-color: transparent;
    color: var(--text);
    text-align: center;
    padding: 12rem 5%;
    position: relative; /* Establishes a stacking context */
    z-index: 2;        /* Lifts the entire section above the canvas (which is z-index: 0) */
}

/* The z-index is no longer needed here as the parent .hero class handles the layering. */
.hero-content { position: relative; }
.hero h1 { font-family: var(--font-heading); font-size: 6rem; margin-bottom: 1rem; font-weight: 800; color: var(--text); letter-spacing: -2px; text-shadow: 0 0 15px rgba(0, 216, 255, 0.3); }
.hero p { font-size: 1.5rem; max-width: 700px; margin: 0 auto 3rem; font-weight: 400; color: var(--sub); }

/* --- FIX FOR BUTTON VISIBILITY --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* A brighter, more engaging background color */
    background: linear-gradient(45deg, #0d162f, #1b2853);
    color: #E0E0E0; /* White text for high contrast */
    padding: 1rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700; /* Bolder font */
    transition: all 0.3s ease;
    /* A more prominent shadow to lift it off the page */
    box-shadow: 0 4px 20px rgba(0, 216, 255, 0.4);
    border: none; /* Removed the old border */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2); /* Subtle text shadow for depth */
    border: 1px solid var(--accent-glow);
}

.btn:hover {
    transform: translateY(-3px); /* Add a slight lift on hover */
    /* Updated hover shadow for a glowing effect */
    box-shadow: 0 8px 30px rgba(0, 216, 255, 0.6);
    /* NEW: Light mode effect on hover */
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    color: #ffffff;
    border: none;
}

.btn:active {
    transform: translateY(0); /* Make the button feel "pressed" */
    box-shadow: 0 2px 10px rgba(0, 216, 255, 0.4);
    /* NEW: Maintain light mode style on click */
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    color: #ffffff;
    border: none;
}

.btn-arrow { font-size: 1.2rem; margin-left: 0.5rem; transition: transform 0.3s ease; }
.btn:hover .btn-arrow { transform: translateX(5px); }
/* --- END OF FIX --- */

.section { padding: 6rem 0; background-color: transparent; position: relative; z-index: 2; }
.section-title { font-family: var(--font-heading); text-align: center; font-size: 3rem; margin-bottom: 1rem; color: var(--text); font-weight: 700; display: block; width: 100%; }
.section-subtitle { font-size: 1.25rem; color: var(--sub); text-align: center; margin-bottom: 3rem; }
.section-title .char, .about-intro .char { display: inline-block; }

/* --- MODIFICATION FOR MODULES LAYOUT --- */
/* The minmax value was reduced from 300px to 250px. */
/* This allows four columns to fit comfortably within the 1200px max-width container, creating the desired 4x2 grid. */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    grid-auto-rows: 1fr;
}

.module-card { 
    background: var(--chip-bg); 
    border-radius: 12px; 
    padding: 2.5rem; 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    border: 1px solid var(--chip-edge); 
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); 
    perspective: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.module-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 216, 255, 0.2); border-color: var(--accent-glow); }
.module-card h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-top: 0; color: var(--accent-glow); font-weight: 700; }
.module-card h4 { font-family: var(--font-body); font-weight: 400; font-size: 1.2rem; color: var(--text); margin-bottom: 1rem; }
.module-card p { font-size: 1rem; color: var(--sub); flex-grow: 1; }

/* --- START: STYLES FOR AI DIAGRAM (FROM layers.html) --- */
#ai-diagram-section svg {
    width: 100%;
    max-width: 1400px; /* Adjusted for better fit */
    height: auto;
    display: block;
    overflow: visible;
    margin: 0 auto;
}
#ai-diagram-section .label { fill: var(--text); font-weight: 600; font-size: 28px; } /* Adjusted font size */
#ai-diagram-section .group-label { fill: var(--text); font-weight: 600; font-size: 24px; } /* Adjusted font size */
#ai-diagram-section .sub { fill: var(--sub); font-weight: 500; font-size: 16px; } /* Adjusted font size */
#ai-diagram-section .node { cursor: pointer; transition: filter 0.3s ease; }
#ai-diagram-section .node .hover-target {
    fill: var(--chip-bg);
    stroke: var(--chip-edge);
    stroke-width: 1.5;
    rx: 14; 
    ry: 14;
    filter: drop-shadow(0 0 12px rgba(0, 150, 200, 0.2));
}
#ai-diagram-section .node:hover .hover-target { filter: drop-shadow(0 0 25px var(--accent-glow)); }
#ai-diagram-section .ds { stroke: var(--datasrc); }
#ai-diagram-section .mod-sens { stroke: var(--sens); }
#ai-diagram-section .mod-reason { stroke: var(--reason); }
#ai-diagram-section .mod-orch { stroke: var(--orch); }
#ai-diagram-section .mod-chat { stroke: var(--chat); }
#ai-diagram-section .outcome { stroke: var(--outcome); }
#ai-diagram-section .big-chip-face {
    fill: rgba(20, 28, 58, 0.5);
    stroke: var(--accent-glow);
    stroke-dasharray: 10, 5;
    rx: 14;
    ry: 14;
}
#ai-diagram-section .trace { stroke: var(--flow); stroke-width: 2.5px; fill: none; }
#ai-diagram-section .trace-thin { stroke: var(--flow); stroke-width: 1.5px; fill: none; }
#ai-diagram-section .signal {
    fill: url(#signalGradient);
    filter: drop-shadow(0 0 10px var(--flow-signal));
}
/* --- END: STYLES FOR AI DIAGRAM --- */

/* --- START: STYLES FOR HUB DIAGRAM (FROM AI.html) --- */
#hub-diagram-section svg {
    width: 100%;
    max-width: 1800px;
    height: auto;
    display: block;
    overflow: visible;
    margin: 0 auto;
}
#hub-diagram-section .label { fill: var(--text); font-weight: 600; font-size: 26px; }
#hub-diagram-section .sub {
    fill: var(--sub);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}
#hub-diagram-section .node { cursor: pointer; transition: filter 0.3s ease; }
#hub-diagram-section .node .hover-target, #hub-diagram-section .node .cpu-base {
    fill: var(--chip-bg);
    stroke: var(--chip-edge);
    stroke-width: 1.5;
    rx: 15; 
    ry: 15;
    filter: drop-shadow(0 0 12px rgba(0, 150, 200, 0.2));
    transition: filter 0.3s ease;
}
#hub-diagram-section .node:hover .hover-target, #hub-diagram-section .node:hover .cpu-base { filter: drop-shadow(0 0 25px var(--accent-glow)); }
#hub-diagram-section .trace { stroke: var(--chip-edge); stroke-width: 1.5px; fill: none; opacity: 0.5; }
#hub-diagram-section .signal {
    fill: url(#hubSignalGradient);
    filter: drop-shadow(0 0 10px var(--flow-signal));
}
#hub-diagram-section .cpu-base { fill: #101830; }
#hub-diagram-section .cpu-core {
    fill: #080D1A;
    stroke: var(--accent-glow);
    stroke-width: 1;
    animation: pulse-glow 3s infinite ease-in-out;
}
#hub-diagram-section .cpu-trace {
    fill: none;
    stroke: rgba(0, 216, 255, 0.2);
    stroke-width: 1.5;
}
#hub-diagram-section .cpu-contact { fill: rgba(46, 178, 222, 0.3); }
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 216, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 216, 255, 0.7)); }
}
/* --- END: STYLES FOR HUB DIAGRAM --- */

/* --- START: REFACTORED ABOUT SECTION STYLES --- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
@media (min-width: 1024px) {
    .about-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.about-card {
    background-color: var(--chip-bg);
    border: 1px solid var(--chip-edge);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 216, 255, 0.15);
    border-color: var(--accent-glow);
}
.about-card-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1.5rem;
    color: var(--accent-glow);
}
.about-card strong {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    flex-grow: 1;
}
.about-card p {
    color: var(--sub);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
/* --- END: REFACTORED ABOUT SECTION STYLES --- */

#industries .industries-layout { display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 1024px) { #industries .industries-layout { flex-direction: row; } }
#industries .tab-buttons { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
@media (min-width: 1024px) { #industries .tab-buttons { width: 30%; } }
#industries .tab-button { background-color: var(--chip-bg); color: var(--text); padding: 1rem 1.5rem; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s ease-in-out; text-align: left; border: 1px solid var(--chip-edge); }
#industries .tab-button:hover { background-color: rgba(20, 28, 58, 0.9); border-color: var(--accent-glow); }
#industries .tab-button.active { background-color: var(--chip-bg); color: var(--accent-glow); box-shadow: 0 0 15px rgba(0, 216, 255, 0.2); border-color: var(--accent-glow); }
#industries .tab-content-wrapper { position: relative; width: 100%; min-height: 250px; }
@media (min-width: 1024px) { #industries .tab-content-wrapper { width: 70%; } }
#industries .tab-content { position: absolute; top: 0; left: 0; width: 100%; padding: 2rem; border-radius: 12px; background: var(--chip-bg); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); border: 1px solid var(--chip-edge); opacity: 0; visibility: hidden; transform: translateY(20px); }
#industries .tab-content.active { opacity: 1; visibility: visible; transform: translateY(0); }
#industries .tab-content h3 { font-size: 1.8rem; font-weight: 700; margin-top: 0; color: var(--accent-glow); }
#industries .tab-content p { font-size: 1rem; color: var(--sub); }

/* --- FIX FOR OVERLAPPING SECTION --- */
/* The height of the container was reduced from 300vh to 250vh. */
/* This gives the animation enough room to complete while ensuring a smoother transition to the next section without overlap. */
.how-work-sc { 
    position: relative; 
    background-color: transparent; 
    height: 250vh; 
    padding-top: 0;
    padding-bottom: 0;
}
.how-work-s { 
    position: relative; 
    z-index: 1; 
    min-height: 250vh; 
}

.how-work-sticky { position: sticky; top: 0; z-index: 1; height: 100vh; display: flex; justify-content: center; align-items: center; text-align: center; overflow: hidden; }
.how-work-widgets-front { position: absolute; inset: 0; z-index: 2; }
.hw-position { position: absolute; will-change: transform; }
.hw-card-block { background: var(--chip-bg); color: var(--text); border: 1px solid var(--chip-edge); padding: 2.5rem; width: 450px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); border-radius: 1.5rem; transition: border-radius 0.4s ease-in-out; display: flex; flex-direction: column; justify-content: center; height: auto; }
.hw-card-block h3 { font-size: 1.8rem; line-height: 2rem; color: var(--accent-glow); }
.hw-card-block p { font-size: 1rem; line-height: 1.75rem; color: var(--sub);}
.how-work-s.is-gridded .how-work-widgets-front { filter: drop-shadow(0 20px 25px rgb(0, 216, 255, 0.1)); }
.how-work-s.is-gridded .hw-card-block { box-shadow: none; border-color: var(--chip-edge); }
.how-work-s.is-gridded .hw-position.s1 .hw-card-block { border-radius: 1.5rem 0 0 0; }
.how-work-s.is-gridded .hw-position.s2 .hw-card-block { border-radius: 0 1.5rem 0 0; }
.how-work-s.is-gridded .hw-position.s3 .hw-card-block { border-radius: 0 0 0 1.5rem; }
.how-work-s.is-gridded .hw-position.s4 .hw-card-block { border-radius: 0 0 1.5rem 0; }
.hw-position.s1 { top: 10%; left: 15%; }
.how-work-headline { color: var(--text); }
.hw-position.s2 { top: 25%; right: 10%; }
.hw-position.s3 { top: 60%; left: 20%; }
.hw-position.s4 { top: 75%; right: 25%; }
.carousel-container { overflow: hidden; margin-top: 2rem; padding: 2rem 0; -webkit-mask-image: linear-gradient(90deg, transparent, white 20%, white 80%, transparent); mask-image: linear-gradient(90deg, transparent, white 20%, white 80%, transparent); }
.carousel-track { display: flex; gap: 2rem; padding: 0; list-style: none; white-space: nowrap; }
.carousel-item { display: inline-flex; flex-shrink: 0; width: 350px; background-color: var(--chip-bg); border-radius: 12px; padding: 2.5rem; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); align-items: center; justify-content: center; border: 1px solid var(--chip-edge); }
.carousel-item strong { color: var(--text); }
.footer { background-color: rgba(10, 15, 30, 0.9); color: var(--text); padding: 3rem 5%; font-size: 0.9rem; border-top: 1px solid var(--chip-edge); position: relative; z-index: 2; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.footer-logo { font-family: var(--font-heading); font-weight: bold; font-size: 1.8rem; color: var(--accent-glow); }
.footer-section h4 { color: var(--text); margin-top: 0; border-bottom: 2px solid var(--accent-glow); padding-bottom: 0.5rem; font-family: var(--font-heading); }
.footer-section ul { list-style: none; padding: 0; }
.footer-section a { text-decoration: none; color: var(--sub); transition: color 0.3s ease; }
.footer-section a:hover { color: var(--accent-glow); }
.social-icons a { display: inline-block; color: var(--sub); font-size: 1.5rem; margin-right: 1rem; }
