:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-primary: #00ff9d; /* Neon Green */
    --accent-secondary: #7000ff; /* Deep Purple */
    --accent-tertiary: #00f3ff; /* Cyan */
    --grid-color: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(20, 20, 20, 0.6);
    --font-heading: 'Syne', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --cursor-size: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    overflow-x: hidden;
    line-height: 1.6;
    touch-action: pan-y;
}

body.loading {
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Cursor */
.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-circle {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}

.cursor-hover .cursor-circle {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.8, 0, 0.2, 1);
}

.loader.loaded {
    transform: translateY(-100%);
}

.loader-content {
    width: 300px;
    text-align: center;
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.loader-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.loader-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    transition: width 0.2s ease;
}

.loader-data {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #666;
}

/* Navigation */
.nav-corner {
    position: fixed;
    z-index: 1000;
    padding: 2rem;
}

.top-left { top: 0; left: 0; }
.top-right { top: 0; right: 0; }

/* Language Switch Button */
.lang-switch {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 0.5rem 1rem;
    cursor: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.lang-switch:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
}

.lang-switch:hover::before {
    left: 100%;
}

.lang-switch:active {
    transform: scale(0.95);
}

.lang-text {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-svg {
    height: 80px;
    width: auto;
    /* Removed filter to allow original SVG colors */
    transition: filter 0.3s ease;
}



.logo:hover .logo-svg {
    filter: brightness(0) invert(1) sepia(1) saturate(10) hue-rotate(100deg) drop-shadow(0 0 5px var(--accent-primary));
}

/* Header Gradient Mask */
.header-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, var(--bg-color) 30%, transparent);
    z-index: 998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.header-mask.active {
    opacity: 1;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.section {
    padding: 150px 0;
    position: relative;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    z-index: 2;
}

.hero-label {
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s 1s forwards;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 6rem;
    line-height: 0.9;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeUp 0.8s 1.2s forwards;
    position: relative;
}

.hero-title.delay-1 {
    animation-delay: 1.4s;
    color: transparent;
    -webkit-text-stroke: 1px #fff;
}

.hero-desc {
    font-size: 1.1rem;
    color: #999;
    max-width: 500px;
    margin: 3rem 0;
    opacity: 0;
    animation: fadeUp 0.8s 1.6s forwards;
}

/* Glitch Button */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    opacity: 0;
    animation: fadeUp 0.8s 1.8s forwards;
    cursor: none;
}

.btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 1s 2.5s forwards;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--accent-primary);
    animation: scrollDrop 2s infinite;
}

@keyframes scrollDrop {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

/* Services */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-primary);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2rem;
    position: relative;
    transition: transform 0.3s;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-card:hover {
    transform: translateY(-5px);
}

.card-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid transparent;
    transition: border-color 0.3s;
    pointer-events: none;
}

.service-card:hover .card-border {
    border-color: var(--accent-primary);
}

.service-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 1.5rem;
}

.tech-list {
    list-style: none;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.tech-list li {
    margin-bottom: 0.5rem;
}

.tech-list li::before {
    content: '>';
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

/* AI Lifecycle Flowchart */
.lifecycle-flow {
    background: rgba(13, 13, 13, 0.8);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 4rem 2rem;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.flow-container {
    display: flex;
    align-items: center;
    min-width: 900px;
    gap: 1rem;
}

.flow-node {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    width: 180px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.flow-node:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.flow-node.featured {
    width: 240px;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.15);
    transform: scale(1.05);
}

.flow-node.featured:hover {
    transform: scale(1.08);
}

.node-header {
    background: #1a1a1a;
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid #333;
}

.flow-node.featured .node-header {
    background: rgba(0, 255, 157, 0.1);
    border-bottom-color: var(--accent-primary);
}

.node-header i {
    color: #666;
    font-size: 1rem;
}

.flow-node.featured .node-header i {
    color: var(--accent-primary);
}

.node-title {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.node-body {
    padding: 1rem;
    font-size: 0.8rem;
}

.node-metric {
    color: #999;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.node-subtitle {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.node-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #bbb;
}

.stat small {
    display: block;
    color: #666;
    font-size: 0.6rem;
}

.node-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #222;
    color: #666;
}

.node-status.active {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-primary);
}

.node-status.success {
    color: var(--accent-primary);
}

.node-status.processing {
    color: var(--accent-tertiary);
}

.node-status.pulse {
    /* animation: textPulse 1.5s infinite; */
}

.node-status.active-pulse {
    animation: textPulse 1.5s infinite;
}

@keyframes textPulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Connectors */
.flow-connector {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
}

.connector-label {
    font-size: 0.6rem;
    color: #555;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connector-line {
    width: 100%;
    height: 2px;
    background: #222;
    position: relative;
    overflow: hidden;
}

.flow-particle {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transform: translateX(-100%);
    opacity: 0;
}

.flow-particle.animating {
    opacity: 1;
    animation: flowMove 1.5s linear forwards;
}

@keyframes flowMove {
    0% { transform: translateX(-100%); left: 0; }
    100% { transform: translateX(600%); left: 0; } /* Use transform for performance */
}

/* Coding Agent Interface */
.agent-interface {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 550px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.agent-header {
    background: #151515;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #222;
}

.agent-controls {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.control-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.control-dot.red { background: #ff5f56; }
.control-dot.yellow { background: #ffbd2e; }
.control-dot.green { background: #27c93f; }

.agent-chat-area {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.9rem;
}

.agent-message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.agent-message.system {
    align-self: flex-start;
    color: #888;
    border-left: 2px solid #444;
    padding-left: 1rem;
    background: transparent;
}

.agent-message.user {
    align-self: flex-end;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #333;
}

.agent-message.agent {
    align-self: flex-start;
    color: var(--accent-primary);
    background: rgba(0, 255, 157, 0.05);
    border: 1px solid rgba(0, 255, 157, 0.2);
    font-family: var(--font-mono);
    width: 100%; /* Agent messages can take full width for code blocks */
    max-width: 100%;
}

.msg-time {
    color: #444;
    font-size: 0.7rem;
    margin-right: 0.5rem;
}

.agent-input-area {
    background: #111;
    padding: 1rem;
    border-top: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.input-label {
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.input-box {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.input-text {
    color: #fff;
}

.cursor-block {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--accent-primary);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h4 {
    color: var(--accent-primary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.contact-info p {
    color: #999;
    margin-bottom: 2rem;
}

.socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.social-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.social-link:hover { color: var(--accent-primary); }

.cyber-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    padding: 0.5rem 0;
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.3s;
}

.input-line-anim {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-primary);
    transition: width 0.3s;
}

.form-group input:focus ~ .input-line-anim,
.form-group textarea:focus ~ .input-line-anim {
    width: 100%;
}

.submit-btn {
    opacity: 1; /* Reset hero opacity animation */
    animation: none;
    align-self: flex-start;
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid #1a1a1a;
    font-size: 0.7rem;
    color: #444;
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scroll Reveal */
.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip-path: inset(44% 0 61% 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip-path: inset(50% 0 30% 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); }
    20% { clip-path: inset(60% 0 10% 0); }
    40% { clip-path: inset(40% 0 50% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(10% 0 70% 0); }
    100% { clip-path: inset(30% 0 20% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); }
    20% { clip-path: inset(30% 0 10% 0); }
    40% { clip-path: inset(70% 0 20% 0); }
    60% { clip-path: inset(20% 0 50% 0); }
    80% { clip-path: inset(50% 0 30% 0); }
    100% { clip-path: inset(10% 0 80% 0); }
}

@keyframes flowMoveVertical {
    0% { transform: translateY(-100%); top: 0; }
    100% { transform: translateY(600%); top: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .section-title { font-size: 1.8rem; }
    .logo-svg { height: 50px; }

    .contact-layout { grid-template-columns: 1fr; }

    .cursor-dot, .cursor-circle { display: none; }
    * { cursor: auto; }

    .lang-switch {
        cursor: pointer;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .nav-corner {
        padding: 1rem;
    }

    /* Vertical Lifecycle Flow */
    .lifecycle-flow {
        overflow-x: hidden;
        padding: 2rem 1rem;
    }

    .flow-container {
        flex-direction: column;
        min-width: auto;
        width: 100%;
        gap: 0;
    }

    .flow-node {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .flow-node.featured {
        width: 100%;
        max-width: 320px;
        transform: scale(1);
    }
    
    .flow-node.featured:hover {
        transform: scale(1.02);
    }

    .flow-connector {
        flex-direction: column;
        width: 100%;
        height: 80px;
        min-width: auto;
        position: relative;
        justify-content: center;
    }
    
    .connector-label {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        background: #0d0d0d;
        padding: 0 10px;
        z-index: 2;
        white-space: nowrap;
        border: 1px solid #222;
        border-radius: 4px;
    }

    .connector-line {
        width: 2px;
        height: 100%;
        position: absolute;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
    }

    .flow-particle {
        width: 100%;
        height: 20%;
        top: 0;
        left: 0;
        background: linear-gradient(180deg, transparent, var(--accent-primary), transparent);
        transform: translateY(-100%);
    }

    .flow-particle.animating {
        animation: flowMoveVertical 1.5s linear forwards;
    }
}