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

:root {
    /* Spatial Color System */
    --primary-violet: #7c3aed;
    --primary-violet-dark: #6d28d9;
    --primary-violet-light: #a78bfa;
    --accent-cyan: #06b6d4;
    --accent-cyan-dark: #0891b2;
    --accent-purple: #8b5cf6;

    /* Semantic Colors */
    --success-green: #10b981;
    --warning-amber: #f59e0b;
    --error-red: #ef4444;

    /* Neutrals with blue tint */
    --neutral-900: #0f172a;
    --neutral-800: #1e293b;
    --neutral-700: #334155;
    --neutral-600: #475569;
    --neutral-500: #64748b;
    --neutral-400: #94a3b8;
    --neutral-300: #cbd5e1;
    --neutral-200: #e2e8f0;
    --neutral-100: #f1f5f9;
    --neutral-50: #f8fafc;

    /* Layout */
    --max-width: 1200px;
    --content-width: 800px;

    /* Spatial Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--neutral-800);
    background: linear-gradient(180deg, var(--neutral-50) 0%, white 100%);
    min-height: 100vh;
    position: relative;
}

/* Spatial Grid Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header with Glassmorphism */
.site-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--transition-base);
}

.site-header:hover {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(139, 92, 246, 0.2);
}

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

/* Logo with spatial coordinates */
.logo {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: var(--neutral-900);
    position: relative;
    letter-spacing: -0.025em;
    transition: all var(--transition-base);
}

.logo:hover {
    color: var(--primary-violet);
    transform: translateX(2px);
}

.logo-icon {
    height: 32px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
}

/* Navigation with hover effects */
.main-nav {
    display: flex;
    gap: 8px;
}

.main-nav a {
    text-decoration: none;
    color: var(--neutral-700);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    position: relative;
    transition: all var(--transition-fast);
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--primary-violet));
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.main-nav a:hover {
    color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.05);
}

.main-nav a:hover::before {
    width: 30px;
}

/* Hamburger Toggle Button */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--neutral-800);
    position: relative;
    transition: background var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--neutral-800);
    transition: transform var(--transition-fast);
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Hamburger animation when open */
.nav-toggle.is-open .hamburger {
    background: transparent;
}

.nav-toggle.is-open .hamburger::before {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.is-open .hamburger::after {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
    padding: 80px 0;
}

.main-content .container {
    max-width: var(--content-width);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 0 60px;
    position: relative;
}

.spatial-coordinates {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.875rem;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    opacity: 0.7;
    letter-spacing: 0.05em;
    animation: pulse 3s infinite;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary-violet) 0%, var(--accent-cyan) 50%, var(--primary-violet) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--neutral-700);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--neutral-600);
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* Typography with improved hierarchy */
h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--neutral-900) 0%, var(--primary-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    color: var(--neutral-900);
    letter-spacing: -0.025em;
    position: relative;
    padding-left: 20px;
}

h2::before {
    content: '//';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    opacity: 0.4;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--neutral-800);
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.25rem;
    color: var(--neutral-700);
    line-height: 1.75;
}

/* Enhanced CTA Cards with depth */
.cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 60px 0;
}

.cta-card {
    padding: 32px;
    background: white;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: var(--neutral-800);
    position: relative;
    transition: all var(--transition-base);
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary-violet));
    border-radius: 12px;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
}

.cta-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 11px;
    z-index: -1;
}

.cta-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

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

.cta-card h3 {
    color: var(--primary-violet);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.cta-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Stats with animated numbers */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 32px;
    margin: 60px 0;
    text-align: center;
}

.stat {
    padding: 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: all var(--transition-base);
}

.stat:hover {
    transform: scale(1.05);
    border-color: rgba(139, 92, 246, 0.3);
}

.stat h3 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-violet) 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.stat p {
    color: var(--neutral-600);
    font-weight: 500;
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* Enhanced Buttons with depth */
.primary-button, .secondary-button {
    display: inline-block;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-violet) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.3);
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(139, 92, 246, 0.4);
}

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

.secondary-button {
    background: white;
    border: 2px solid var(--primary-violet);
    color: var(--primary-violet);
}

.secondary-button:hover {
    background: var(--primary-violet);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(139, 92, 246, 0.3);
}

/* Code Blocks with terminal aesthetic */
pre {
    background: var(--neutral-900);
    color: var(--neutral-100);
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    position: relative;
    box-shadow: var(--shadow-lg);
}

pre::before {
    content: '$ ';
    color: var(--accent-cyan);
    font-weight: bold;
}

code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-violet-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Lists with custom markers */
ul {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

ul li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 0.75rem;
}

ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

/* Quick Start Box */
.quick-start {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 2px solid var(--success-green);
    border-radius: 12px;
    padding: 32px;
    margin: 40px 0;
    position: relative;
}


/* Footer with gradient */
.site-footer {
    background: linear-gradient(180deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
    padding: 60px 0 30px;
    margin-top: 120px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-violet), transparent);
    opacity: 0.3;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 48px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--neutral-900);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-section ul li::before {
    display: none;
}

.footer-section ul li {
    padding-left: 0;
}

.footer-section a {
    color: var(--neutral-600);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-violet);
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--neutral-200);
    color: var(--neutral-500);
    font-size: 0.875rem;
}

/* Special Elements */
.form-placeholder,
.architecture-placeholder {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    margin: 40px 0;
    position: relative;
}

/* Responsive video container */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: white;
        padding: 20px 0;
        gap: 0;
        border-top: 1px solid var(--neutral-200);
        margin-top: 20px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        padding: 12px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--neutral-100);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a::before {
        display: none;
    }

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

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

    .main-content {
        padding: 40px 0;
    }
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

/* Apply subtle animations */
.stat:hover h3 {
    animation: pulse 2s infinite;
}

/* Form embed container - Google Forms need explicit large height */
.form-container {
    width: 100%;
    margin: 2rem 0;
}

.form-container iframe {
    width: 100%;
    height: 1950px;
    border: none;
}

@media (max-width: 768px) {
    .form-container iframe {
        height: 2400px;
    }
}

/* Shorter form for contact page */
.form-container-short iframe {
    height: 950px;
}

@media (max-width: 768px) {
    .form-container-short iframe {
        height: 1100px;
    }
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.project-card {
    display: block;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 2px solid var(--primary-violet);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: var(--neutral-800);
    transition: all var(--transition-base);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--accent-cyan);
}

.project-card h3 {
    color: var(--primary-violet);
    margin: 0 0 12px 0;
    font-size: 1.25rem;
}

.project-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Partners Grid */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.partner-card {
    background: white;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all var(--transition-base);
}

.partner-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 92, 246, 0.3);
}

.partner-card img {
    max-width: 180px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
}

.partner-card h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: var(--neutral-900);
}

.partner-card p {
    font-size: 0.9rem;
    margin: 4px 0;
    color: var(--neutral-600);
    line-height: 1.5;
}

.partner-card p strong {
    color: var(--neutral-700);
}

/* Print styles */
@media print {
    body::before,
    .site-header,
    .site-footer {
        display: none;
    }
}