:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(16, 24, 40, 0.7);
    --text-color: #e0e6ed;

    /* Neon Palette */
    --highlight: #00f3ff;
    /* Cyan */
    --highlight-dim: rgba(0, 243, 255, 0.15);

    --secondary: #d902ee;
    /* Neon Pink/Purple */
    --secondary-dim: rgba(217, 2, 238, 0.15);

    --accent: #ffd700;
    /* Gold/Yellow for alerts or highlights */

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shapes */
    --clip-corner: polygon(10px 0, 100% 0,
            100% calc(100% - 10px), calc(100% - 10px) 100%,
            0 100%, 0 10px);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, #1a2236 0%, #0b0f19 100%);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Animations */
@keyframes glowPulse {
    0% {
        text-shadow: 0 0 5px var(--highlight-dim);
    }

    50% {
        text-shadow: 0 0 20px var(--highlight), 0 0 10px var(--highlight);
    }

    100% {
        text-shadow: 0 0 5px var(--highlight-dim);
    }
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

.highlight {
    color: var(--highlight);
    text-shadow: 0 0 10px var(--highlight);
    animation: glowPulse 3s infinite;
}

.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: #fff;
    text-shadow: 2px 0 var(--secondary), -2px 0 var(--highlight);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    padding: 1.2rem 0;
    border-bottom: 2px solid rgba(0, 243, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fff, var(--highlight));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    position: relative;
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--secondary);
}

.nav-links a:hover::before {
    width: 100%;
}

.nav-links a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--secondary);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 100px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.3rem;
    color: #a0aab5;
    margin-bottom: 3rem;
    border-left: 3px solid var(--secondary);
    padding-left: 1.5rem;
    max-width: 650px;
}

/* Hexagon/Polygon Logo Style */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 2rem;
}

.hero-image::before {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: spin 15s linear infinite;
    opacity: 0.8;
    box-shadow: 0 0 15px var(--secondary-dim);
}

.hero-image::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border: 1px dashed var(--highlight);
    border-radius: 50%;
    animation: spinReverse 20s linear infinite;
    opacity: 0.5;
}

.floating-logo {
    width: 300px;
    height: 300px;
    object-fit: cover;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    transition: var(--transition);
    z-index: 2;
    background-color: #fff;
}

.floating-logo:hover {
    transform: scale(1.05);
    filter: contrast(1.2) brightness(1.2) drop-shadow(0 0 20px var(--highlight-dim));
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    100% {
        transform: rotate(-360deg);
    }
}

/* Buttons */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    clip-path: var(--clip-corner);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--highlight);
    color: #000;
    box-shadow: 0 0 25px var(--highlight-dim);
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 35px var(--highlight);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary);
    box-shadow: 0 0 30px var(--secondary-dim);
    color: #fff;
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 8rem 0;
    position: relative;
}

.section::before {
    content: 'AI-CREW';
    position: absolute;
    top: 5rem;
    right: 0;
    font-size: 10rem;
    font-family: var(--font-heading);
    color: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    z-index: -1;
}

.section-title {
    text-align: left;
    font-size: 3rem;
    margin-bottom: 4rem;
    position: relative;
    padding-left: 20px;
    border-left: 5px solid var(--highlight);
}

/* Cards */
.card {
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.6) 0%, rgba(10, 15, 25, 0.8) 100%);
    padding: 2.5rem;
    border: 1px solid rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(10px);
    clip-path: var(--clip-corner);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--highlight);
    box-shadow: 0 10px 40px rgba(0, 243, 255, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.card:hover::before {
    left: 100%;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.service-card {
    display: flex;
    flex-direction: column;
}

.service-card .icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px var(--highlight));
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--highlight);
}

.service-card .btn {
    margin-top: auto;
}

.service-list li {
    margin-bottom: 0.8rem;
    color: #b0b8c4;
    padding-left: 1.2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

/* Training */
.dark-bg {
    background: linear-gradient(0deg, rgba(11, 15, 25, 0.8), rgba(20, 0, 30, 0.3));
}

.training-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.training-card.featured {
    border: 2px solid var(--secondary);
    background: rgba(20, 10, 30, 0.6);
    box-shadow: 0 0 30px rgba(217, 2, 238, 0.1);
}

.training-card h3 {
    color: #ff6bf7;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lead {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    text-shadow: 0 0 5px var(--secondary);
}

.check-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.small-btn {
    margin-top: 1.5rem;
    font-size: 0.8rem;
}

.info-block {
    padding: 2rem;
    border-left: 1px solid var(--highlight);
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.05), transparent);
}

.info-block h4 {
    color: var(--highlight);
    margin-bottom: 1rem;
}

/* Team */
.team-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.team-member {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    text-align: left;
    border-top: 3px solid var(--highlight);
}

.team-member h3 {
    font-size: 1.5rem;
}

.team-member .role {
    color: var(--secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    display: block;
}

/* Contact */
.contact-container {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-box {
    background: rgba(5, 10, 20, 0.9);
    padding: 4rem;
    border: 1px solid var(--highlight);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.05);
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 700px;
}

.contact-box::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 50px;
    height: 50px;
    border-right: 3px solid var(--secondary);
    border-bottom: 3px solid var(--secondary);
}

.contact-box::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    width: 50px;
    height: 50px;
    border-left: 3px solid var(--secondary);
    border-top: 3px solid var(--secondary);
}

.contact-box a {
    color: var(--highlight);
    font-weight: bold;
    font-size: 1.5rem;
}

/* Footer */
footer {
    padding: 3rem 0;
    text-align: center;
    background: #05080f;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #4a5568;
}

/* Fade In */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- NEURAL UPLINK / CHAT STYLES --- */

/* FAB Button */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(11, 15, 25, 0.9);
    border: 2px solid var(--highlight);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    transition: all 0.3s ease;
}

.fab-container:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6);
}

.fab-icon {
    font-size: 24px;
    color: var(--highlight);
}

.fab-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--highlight);
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Terminal Modal */
.terminal-overlay {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 600px;
    height: 800px;
    max-height: calc(100vh - 150px);
    background: rgba(10, 15, 20, 0.98);
    border: 2px solid var(--highlight);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px var(--highlight-dim);
    z-index: 2000;
    display: flex;
    /* Flex on overlay */
    flex-direction: column;
    font-family: var(--font-mono);
    border-radius: 8px;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

.terminal-overlay.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Wrapper for inner layout */
.terminal-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.terminal-header {
    background: rgba(0, 243, 255, 0.15);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(0, 243, 255, 0.3);
    flex-shrink: 0;
    /* Never shrink header */
}

.terminal-logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    border: 1px solid var(--highlight);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #0f0;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 8px #0f0;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.terminal-title {
    font-size: 1.1rem;
    color: var(--highlight);
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--highlight);
}

.close-terminal {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--highlight);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-terminal:hover {
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary);
    transform: scale(1.1);
}

.terminal-body {
    flex: 1;
    /* Take all available space */
    padding: 25px;
    overflow-y: auto;
    /* Scroll ONLY this area */
    font-size: 1.25rem;
    color: #e0e6ed;
    scrollbar-width: thin;
    scrollbar-color: var(--highlight) transparent;
    display: flex;
    flex-direction: column;
    /* Stack messages */
    line-height: 1.6;
}

.terminal-body::-webkit-scrollbar {
    width: 5px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background-color: var(--highlight);
    border-radius: 10px;
}

/* Restored Message Styles */
.message {
    margin-bottom: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user {
    color: #fff;
    text-align: right;
}

.message.ai {
    color: var(--highlight);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.message.system {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-top: 10px;
    background: rgba(217, 2, 238, 0.05);
    padding: 10px;
    border-left: 2px solid var(--secondary);
}

.prefix {
    opacity: 0.8;
    font-size: 0.9rem;
    margin-right: 8px;
    font-weight: bold;
    color: var(--highlight);
}

.terminal-input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid rgba(0, 243, 255, 0.3);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Never shrink input area */
}

.prompt {
    color: #0f0;
    margin-right: 15px;
    font-size: 1.5rem;
    font-weight: bold;
}

.terminal-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    outline: none;
}

#sendBtn {
    background: transparent;
    border: 2px solid var(--highlight);
    color: var(--highlight);
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 10px;
}

#sendBtn:hover {
    background: var(--highlight);
    color: #000;
}

/* Burger Menu (Hidden on Desktop) */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--highlight);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Mobile/Tablet Menu Logic (< 900px) */
@media (max-width: 900px) {
    .burger {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        right: 0px;
        top: 0px;
        height: 100vh;
        width: 60%;
        background-color: var(--bg-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--highlight);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(10px);
    }

    .nav-links.active {
        transform: translateX(0%);
    }

    .nav-links li {
        margin: 1.5rem 0;
        opacity: 0;
        /* Fade in effect handled by JS usually, or simple transition */
        animation: navLinkFade 0.5s ease forwards 0.3s;
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Burger Animation */
    .burger.toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger.toggle .line2 {
        opacity: 0;
    }

    .burger.toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .subtitle {
        border-left: none;
        padding-left: 0;
        margin: 0 auto 2rem auto;
    }

    .training-content {
        grid-template-columns: 1fr;
    }
}

/* Small Screens (< 500px) - Refinements */
@media (max-width: 500px) {
    .container {
        padding: 0 1.5rem;
    }

    .nav-links {
        width: 80%;
        /* Wider menu on small phones */
    }

    .section {
        padding: 4rem 0;
    }


    .hero-text h1 {
        font-size: 2.2rem;
    }

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

    .training-card h3 {
        font-size: 1.5rem;
    }

    .hero-image::before {
        width: 280px;
        height: 280px;
    }

    .hero-image::after {
        width: 320px;
        height: 320px;
    }

    .floating-logo {
        width: 220px;
        height: 220px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        gap: 2rem;
    }

    .team-member {
        min-width: 100%;
        border-top: 2px solid var(--highlight);
    }

    .contact-box {
        padding: 2rem 1.5rem;
    }

    .btn {
        width: 100%;
        max-width: 350px;
        margin: 0 auto 10px auto;
        padding: 1rem;
        font-size: 0.9rem;
    }

    .burger {
        display: block;
        cursor: pointer;
        z-index: 1001;
        margin-right: 15px;
    }

    /* Terminal on Mobile */
    .terminal-overlay {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        height: 85vh;
        max-height: calc(100vh - 100px);
    }

    .terminal-body {
        font-size: 1.1rem;
        padding: 15px;
    }

    .terminal-title {
        font-size: 0.9rem;
    }

    .terminal-input-area input {
        font-size: 1.1rem;
    }

    .terminal-logo {
        width: 30px;
        height: 30px;
    }
}