/* --- Color Palette --- */
:root {
    --dark-bg: #030514; /* Very dark blue/black background */
    --primary-accent: #0066ff; /* Bright cyan accent */
    --secondary-accent: #9300c5; /* Bright magenta/purple accent */
    --text-light: #f0f4f8; /* Off-white for main text */
    --text-medium: #a0a8b0; /* Medium grey for less important text */
    --text-dark: #030514; /* For light backgrounds (e.g., button hover) */
    --glow-color: rgba(0, 224, 255, 0.3); /* Cyan glow */
    --shadow-color: rgba(0, 0, 0, 0.5); /* Text shadow color */
    --card-bg: rgba(10, 15, 40, 0.35); /* Card background */
    --card-border: rgba(0, 224, 255, 0.1); /* Slightly dimmer border */
    --card-hover-bg: rgba(15, 20, 50, 0.5);
    --card-hover-border: rgba(0, 224, 255, 0.5);
}

/* --- Base & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor for custom one */
}

html {
    font-size: 16px;
    scroll-behavior: auto !important; /* Disable browser smooth scroll for GSAP */
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Poppins", sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    position: relative;
    overscroll-behavior-y: none; /* Prevent bounce/refresh */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide scrollbar */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Body states */
body.loading {
    overflow: hidden;
}

body.snapping {
    overflow: hidden !important;
}

body.loaded { /* Style after load if needed */
}

/* --- Loader Style (Fade Out) --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    /* Style for optional text/logo inside loader */
}

/* --- Custom Cursor Styles --- */
#cursor, #cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: transform 0.1s ease-out, opacity 0.3s ease, background-color 0.3s ease, width 0.3s ease, height 0.3s ease;
    will-change: transform;
}

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

#cursor-follower {
    width: 30px;
    height: 30px;
    border: 1px solid var(--primary-accent);
    opacity: 0.5;
    transition-duration: 0.4s; /* Slightly slower follower */
}

body:not(.is-touchdevice) #cursor,
body:not(.is-touchdevice) #cursor-follower {
    display: block;
}

body.is-touchdevice #cursor,
body.is-touchdevice #cursor-follower {
    display: none; /* Hide on touch */
}

/* Cursor interaction states */
.interactive:hover ~ #cursor {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.8;
}

.interactive:hover ~ #cursor-follower {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: var(--glow-color);
    border-color: transparent;
}


/* --- General Layout & Structure --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#sections-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
}

section {
    min-height: 100vh;
    height: 100vh; /* Needed for reliable snapping */
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 8%;
    position: relative; /* Changed from absolute */
    overflow: hidden;
    opacity: 0; /* Start hidden */
    transition: opacity 0.7s ease-out;
}

section.active-section {
    opacity: 1;
    z-index: 2;
}

.content {
    max-width: 1100px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 3;
}

#capabilities .content, #applications .content {
    text-align: left;
}

#capabilities h2, #capabilities h3, #applications h2, #applications h3 {
    text-align: center;
    width: 100%;
}

/* --- Typography with Text Shadow --- */
h1, h2, h3, p {
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.6); /* Slightly stronger shadow */
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.8rem; /* More margin */
    color: var(--text-light);
}

h1 {
    font-size: clamp(3.2rem, 7vw, 5.5rem);
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    text-shadow: none; /* Remove shadow from gradient text */
}

h2 {
    font-size: clamp(2.5rem, 6vw, 4rem); /* Slightly larger H2 */
    margin-bottom: 2.5rem; /* More space after H2 */
}

h3 {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)) no-repeat;
    background-size: 45%;
    background-position-x: 50%;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
    margin-top: -1.5rem;
}
#realtime {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)) no-repeat;
    background-size: 80%;
    background-position-x: 50%;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
    margin-top: -1.5rem;
}
#flow {
    background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)) no-repeat;
    background-size: 20%;
    background-position-x: 50%;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: none;
    margin-top: -1.5rem;
}

p {
    font-size: clamp(1.25rem, 2.1vw, 1.4rem); /* Slightly larger paragraph */
    line-height: 1.5; /* More line spacing */
    margin: 0 auto 2.8rem auto;
    color: var(--text-medium);
    max-width: 700px; /* Slightly narrower */
}
#flowP {
    font-size: clamp(1.25rem, 2.1vw, 1.4rem); /* Slightly larger paragraph */
    line-height: 1.5; /* More line spacing */
    /*margin: 0 auto 2.8rem auto;*/
    color: var(--text-medium);
    max-width: 700px; /* Slightly narrower */
}
#flowP1 {
    font-size: clamp(1.25rem, 2.1vw, 1.4rem); /* Slightly larger paragraph */
    line-height: 1.5; /* More line spacing */
    color: var(--text-medium);
    max-width: 700px; /* Slightly narrower */
}

/* --- Button Styles --- */
.btn {
    display: inline-block;
    padding: 16px 40px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 2px;
    border-radius: 50px;
    background: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    text-decoration: none;
    text-transform: uppercase;
    cursor: none; /* Use custom cursor */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:hover {
    color: var(--text-dark);
    border-color: var(--primary-accent);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--glow-color);
}

.btn::before { /* Hover fill effect */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.btn:hover::before {
    transform: scaleX(1);
}

.btn-glow {
    animation: pulse 2.8s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 8px 0 var(--glow-color);
    }
    50% {
        box-shadow: 0 0 18px 5px var(--glow-color);
    }
}

/* --- Grid Card Styles --- */
.capabilities-grid, .applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.2rem;
    margin-top: 3rem;
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.capability-item, .application-item {
    padding: 1.8rem;
    border-radius: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    transform: translateY(30px);
    text-align: center;
    cursor: none;
}

.capability-item:hover, .application-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--card-hover-border);
    background: var(--card-hover-bg);
}

.capability-item h3, .application-item h3 {
    margin-top: -0.7rem;
    margin-bottom: 0.7rem;
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 500;
}

.capability-item p, .application-item p {
    font-size: 0.9rem;
    margin-bottom: -10px;
    color: var(--text-medium);
    line-height: 1.6;
}

/* --- Social Icons --- */
.social-icons {
    display: flex;
    gap: 1.4rem;
    margin-top: 2.8rem;
    justify-content: center;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--text-medium);
    color: var(--text-medium);
    font-size: 1.0rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: none;
}

.social-icon:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--glow-color);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: -70px; /* Adjusted position */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-medium);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
    cursor: none;
}

.scroll-indicator.visible {
    opacity: 0.6;
}

.scroll-indicator.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.scroll-indicator:hover {
    opacity: 0.9;
    color: var(--primary-accent);
}

.scroll-indicator:hover .mouse {
    border-color: var(--primary-accent);
}

.scroll-indicator:hover .mouse::before {
    background-color: var(--primary-accent);
}

.scroll-indicator span {
    font-size: 0.65rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

.mouse {
    width: 18px;
    height: 30px;
    border: 1px solid var(--text-medium);
    border-radius: 8px;
    position: relative;
    transition: border-color 0.3s ease;
}

.mouse::before { /* Scroll wheel dot */
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5px;
    background-color: var(--text-medium);
    border-radius: 2px;
    animation: scrollAnim 2s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
    transition: background-color 0.3s ease;
}

@keyframes scrollAnim {
    0%, 100% {
        transform: translate(-50%, 0px);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, 8px);
        opacity: 0;
    }
}

/* --- Fade-in Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1s cubic-bezier(0.165, 0.84, 0.44, 1), transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.active-section .fade-in { /* Only animate when section is active */
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays applied via JS */

/* Stagger grid items applied via JS */
.active-section .capability-item,
.active-section .application-item {
    opacity: 1;
    transform: translateY(0);
}


/* --- Optional Particle Count --- */
.particle-count {
    position: fixed;
    bottom: 10px;
    right: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
    display: none; /* Hidden by default */
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }

    .capabilities-grid, .applications-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body.is-touchdevice {
        cursor: auto;
    }

    #cursor, #cursor-follower {
        display: none !important;
    }

    /* Ensure cursor hidden */
    section {
        padding: 60px 5%;
        height: auto;
        min-height: 95vh;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    h3 {
        font-size: 1.8rem;
    }

    p {
        max-width: 95%;
        font-size: 1rem;
    }

    /* Adjust mobile font */
    .capabilities-grid, .applications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .scroll-indicator {
        bottom: 15px;
    }
}