/* ===================================
   FactorSpaces - Neo-Geo Design System
   Refined Geometric Patterns & Mathematical Beauty
   =================================== */

/* === CSS Variables & Design Tokens === */
:root {
    /* Color Palette - Refined Neo-Geo */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-bg: #0a0e27;
    --darker-bg: #050816;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --glow-purple: rgba(102, 126, 234, 0.4);
    --glow-pink: rgba(245, 87, 108, 0.4);
    --glow-cyan: rgba(0, 242, 254, 0.4);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

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

    /* Geometric Constants */
    --golden-ratio: 1.618;
    --phi: 1.618033988749895;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background: var(--darker-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* === Animated Geometric Background === */
.geometric-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: var(--darker-bg);
}

.geometric-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(102, 126, 234, 0.03) 2px, rgba(102, 126, 234, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(102, 126, 234, 0.03) 2px, rgba(102, 126, 234, 0.03) 4px);
    animation: gridMove 20s linear infinite;
}

.geo-shape {
    position: absolute;
    opacity: 0.1;
    animation: float 20s ease-in-out infinite;
}

.geo-shape.hexagon {
    width: 200px;
    height: 200px;
    background: var(--primary-gradient);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.geo-shape.triangle {
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-bottom: 260px solid;
    border-image: var(--accent-gradient) 1;
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.geo-shape.circle {
    width: 300px;
    height: 300px;
    background: var(--secondary-gradient);
    border-radius: 50%;
    top: 40%;
    left: 70%;
    animation-delay: -10s;
}

.geo-shape.square {
    width: 180px;
    height: 180px;
    background: var(--accent-gradient);
    transform: rotate(45deg);
    bottom: 15%;
    left: 15%;
    animation-delay: -15s;
}

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

    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(5deg);
    }

    50% {
        transform: translateY(-60px) rotate(-5deg);
    }

    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* === Main Content Container === */
.content {
    position: relative;
    z-index: 1;
}

/* === Header/Navigation === */
header {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(10, 14, 39, 0.7);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

nav ul {
    display: flex;
    gap: var(--spacing-md);
    list-style: none;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover {
    color: var(--text-primary);
}

nav a:hover::after {
    width: 80%;
}

/* === Hero Section === */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, #ffffff 0%, #667eea 50%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 20px var(--glow-purple));
    }

    50% {
        filter: drop-shadow(0 0 40px var(--glow-pink));
    }
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-weight: 300;
    letter-spacing: 0.02em;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

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

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

/* === Geometric Divider === */
.geo-divider {
    width: 100%;
    height: 100px;
    position: relative;
    overflow: hidden;
}

.geo-divider svg {
    width: 100%;
    height: 100%;
}

/* === Services Section === */
.services {
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 0.1;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-sm);
    background: var(--primary-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* === Contact Section === */
.contact {
    padding: var(--spacing-xl) var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: var(--spacing-md);
    backdrop-filter: blur(10px);
    min-width: 300px;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.contact-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.contact-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* === Footer === */
footer {
    padding: var(--spacing-lg);
    text-align: center;
    border-top: 1px solid var(--card-border);
    background: rgba(10, 14, 39, 0.5);
    backdrop-filter: blur(10px);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    header {
        padding: var(--spacing-sm) var(--spacing-md);
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    nav ul {
        gap: var(--spacing-sm);
    }

    nav a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .hero {
        min-height: 70vh;
        padding: var(--spacing-md);
    }

    .services,
    .contact {
        padding: var(--spacing-md);
    }

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

    .contact-info {
        flex-direction: column;
    }
}

/* === Utility Classes === */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}