/* Factory AI-Inspired Design System */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #e5e5e5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --border-color: #2a2a2a;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Section */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--spacing-xl) 0;
}

/* Animated Background Grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

.bg-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.05), transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Content Wrapper */
.content {
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    animation: fadeIn var(--transition-slow) ease-out;
}

.hero__name {
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.hero__title {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.hero__description {
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Terminal Effect */
.terminal-text {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    display: inline-block;
    position: relative;
}

.terminal-text::after {
    content: '█';
    animation: blink 1s infinite;
    margin-left: 2px;
}

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

/* Services Section */
.services {
    padding: var(--spacing-xl) 0;
}

.services__title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    max-width: 900px;
    margin: 0 auto;
}

/* Service Card */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.1);
}

.card:hover::before {
    opacity: 1;
}

.card__icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

/* Custom SVG Icons */
.card__icon-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card__icon-svg svg {
    width: 100%;
    height: 100%;
    color: var(--accent-primary);
}

/* AI Integration Icon Animations */
.icon-ai .node {
    animation: neuralPulse 3s ease-in-out infinite;
}

.icon-ai .node-1 {
    animation-delay: 0s;
}

.icon-ai .node-2 {
    animation-delay: 0.3s;
}

.icon-ai .node-3 {
    animation-delay: 0.6s;
}

.icon-ai .node-4 {
    animation-delay: 0.9s;
}

.icon-ai .connection {
    animation: lineFlow 4s ease-in-out infinite;
}

.icon-ai .connection-1 {
    animation-delay: 0s;
}

.icon-ai .connection-2 {
    animation-delay: 0.5s;
}

.icon-ai .connection-3 {
    animation-delay: 1s;
}

.icon-ai .connection-4 {
    animation-delay: 1.5s;
}

.icon-ai .particle {
    animation: particleMove 6s ease-in-out infinite;
}

.icon-ai .particle-1 {
    animation-delay: 0s;
}

.icon-ai .particle-2 {
    animation-delay: 3s;
}

/* Business Automation Icon Animations */
.icon-automation .gear-center {
    animation: gearRotate 8s linear infinite;
    transform-origin: 32px 32px;
}

.icon-automation .gear-tooth {
    animation: gearRotate 8s linear infinite;
    transform-origin: 32px 32px;
}

.icon-automation .flow-arrow {
    animation: flowPulse 2s ease-in-out infinite;
}

.icon-automation .flow-1 {
    animation-delay: 0s;
}

.icon-automation .flow-2 {
    animation-delay: 1s;
}

.icon-automation .arrow-head {
    animation: arrowGlow 2s ease-in-out infinite;
}

/* Keyframe Animations */
@keyframes neuralPulse {
    0%, 100% {
        opacity: 0.6;
        filter: drop-shadow(0 0 3px var(--accent-primary));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--accent-primary));
    }
}

@keyframes lineFlow {
    0%, 100% {
        opacity: 0.3;
        stroke-dasharray: 0, 100;
    }
    50% {
        opacity: 0.8;
        stroke-dasharray: 100, 0;
    }
}

@keyframes particleMove {
    0%, 100% {
        opacity: 0;
        transform: translateY(0);
    }
    25% {
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translateY(20px);
    }
    75% {
        opacity: 0;
    }
}

@keyframes gearRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes flowPulse {
    0%, 100% {
        opacity: 0.4;
        stroke-width: 1.5;
    }
    50% {
        opacity: 1;
        stroke-width: 2.5;
    }
}

@keyframes arrowGlow {
    0%, 100% {
        opacity: 0.6;
        filter: drop-shadow(0 0 2px var(--accent-primary));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 6px var(--accent-primary));
    }
}

.card__title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.card__description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Contact Section */
.contact {
    text-align: center;
}

.contact__terminal {
    max-width: 600px;
    margin: var(--spacing-lg) auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    font-family: var(--font-mono);
}

.contact__terminal-header {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.contact__terminal-body {
    text-align: left;
    color: var(--accent-primary);
    font-size: 0.95rem;
}

/* Projects Section */
.projects {
    padding: var(--spacing-xl) 0;
}

.projects__title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
    max-width: 1100px;
    margin: 0 auto;
}

/* Terminal Card */
.terminal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    text-decoration: none;
    display: block;
    position: relative;
}

.terminal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.03), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.terminal-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 255, 136, 0.15);
}

.terminal-card:hover::before {
    opacity: 1;
}

.terminal-card__header {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.terminal-card__body {
    padding: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.terminal-prompt {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.terminal-status {
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.status-running {
    color: var(--accent-primary);
    animation: statusPulse 2s ease-in-out infinite;
}

.terminal-details {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.terminal-details p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
    display: inline-block;
}

.terminal-link {
    color: var(--accent-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
    display: inline-block;
}

.terminal-card:hover .terminal-link {
    color: var(--accent-primary);
    transform: translateX(4px);
}

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

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        filter: brightness(1.3);
    }
}

/* Responsive */
@media (max-width: 768px) {
    section {
        padding: var(--spacing-lg) 0;
    }

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

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

    .container {
        padding: 0 var(--spacing-sm);
    }

    .card__icon-svg {
        width: 64px;
        height: 64px;
    }

    .terminal-card__body {
        font-size: 0.85rem;
    }
}

/* Utility Classes */
.text-mono {
    font-family: var(--font-mono);
}

.text-accent {
    color: var(--accent-primary);
}

.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 1000;
}

.language-switcher form {
    display: inline-block;
}

.lang-buttons {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    font-family: var(--font-mono);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.lang-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.lang-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.lang-btn.active:hover {
    background: var(--accent-secondary);
}

/* Responsive language switcher */
@media (max-width: 768px) {
    .language-switcher {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .lang-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}
