/* ==========================================================================
   LOVELACE FEYNMAN TECHNOLOGIES - DESIGN SYSTEM & CORE STYLES
   ========================================================================== */

/* --- Variables --- */
:root {
    color-scheme: dark;
    --bg-dark: #05050c;
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Quantum Palette */
    --quantum-primary: #8b5cf6; /* Violet */
    --quantum-primary-rgb: 139, 92, 246;
    --quantum-secondary: #06b6d4; /* Cyan */
    --quantum-secondary-rgb: 6, 182, 212;
    --quantum-pink: #ec4899; /* Love Rose */
    --quantum-pink-rgb: 236, 72, 153;
    
    /* Glassmorphism Styles */
    --glass-bg: rgba(17, 24, 39, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.35);
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, var(--text-light) 30%, #a78bfa 100%);
    --gradient-hero-alt: linear-gradient(135deg, #22d3ee 0%, var(--quantum-pink) 100%);
    --gradient-cosmic: linear-gradient(180deg, rgba(5, 5, 12, 0) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(5, 5, 12, 0) 100%);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-dark);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, .logo-text, .badge-quantum, .control-label, .formula-overlay {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

/* --- Global Layout Containers --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.small-container {
    max-width: 800px;
}

/* --- Quantum Background Canvas --- */
#quantum-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #0e0e22 0%, var(--bg-dark) 100%);
}

/* --- Header / Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(5, 5, 12, 0.7);
    padding: 16px 0;
    transition: padding 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-light);
}

.logo-svg {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.accent-text {
    background: linear-gradient(90deg, var(--quantum-primary), var(--quantum-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.25s ease;
}

.nav-link:hover {
    color: var(--text-light);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 10px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    background: var(--quantum-primary);
    border-color: var(--quantum-primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

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

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.hero-content {
    z-index: 10;
}

.badge-quantum {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #c084fc;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pulse-icon {
    animation: heart-pulse 2s infinite ease-in-out;
}

.hero-title {
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    color: var(--text-light);
}

.gradient-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-alt {
    background: var(--gradient-hero-alt);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--quantum-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* --- Hero Interactive Orb --- */
.hero-interactive {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantum-globe-container {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#hero-orbital-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* --- Mathematical Formulas Visual Decoration --- */
.formula-overlay {
    position: absolute;
    color: rgba(255, 255, 255, 0.06);
    font-size: 1.25rem;
    user-select: none;
    pointer-events: none;
    letter-spacing: 1px;
}

.formula-1 { top: -20px; left: 20px; font-weight: 500; }
.formula-2 { bottom: -20px; right: 0; }
.formula-3 { top: 60%; left: -60px; font-size: 0.95rem; }

/* --- Scroll Indicator --- */
.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    z-index: 10;
}

.scroll-text {
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-arrow {
    animation: bounce 2s infinite ease-in-out;
}

/* --- Glassmorphism Cards --- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 10px 30px var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

/* --- Ecosystem Section --- */
.ecosystem-section {
    padding: 120px 0;
    position: relative;
    background: var(--gradient-cosmic);
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.ecosystem-card {
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.ecosystem-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
}

.card-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--color);
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.ecosystem-card:hover .card-glow {
    opacity: 0.3;
}

.card-icon-container {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.card-icon {
    font-size: 1.6rem;
}

.card-icon-svg {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ecosystem-card:hover .card-icon-svg {
    transform: scale(1.12);
}


.card-title {
    font-size: 1.45rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.card-badge-alt {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 28px;
    flex-grow: 1;
}

.card-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-link:hover {
    color: var(--quantum-primary);
}

.card-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-green { color: #10b981; }
.text-cyan { color: #22d3ee; }

/* --- Wave Sandbox Section --- */
.sandbox-section {
    padding: 100px 0;
}

.sandbox-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    padding: 48px;
    align-items: center;
}

.sandbox-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sandbox-title {
    font-size: 2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wave-icon {
    color: var(--quantum-secondary);
}

.sandbox-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.sandbox-desc-sub {
    color: #a78bfa;
    font-size: 0.85rem;
}

.controls-grid {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.control-value {
    color: var(--quantum-secondary);
    font-weight: bold;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.slider:focus-visible {
    outline: 2px solid var(--quantum-secondary);
    outline-offset: 4px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--quantum-secondary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.beat-icon {
    animation: heart-beat 1.2s infinite ease-in-out;
}

.sandbox-canvas-container {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

#sandbox-wave-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Corporate About & Contact --- */
.about-section {
    padding: 100px 0 140px;
}

.about-card {
    padding: 48px;
    text-align: center;
}

.about-header {
    margin-bottom: 24px;
}

.about-title {
    font-size: 2rem;
    margin-bottom: 8px;
}

.about-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 32px;
}

.about-contact-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.contact-link-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease;
}

.contact-link-item:hover {
    color: var(--quantum-pink);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 32px 0;
    background: rgba(5, 5, 12, 0.9);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link-item {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-link-item:hover {
    color: var(--text-light);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes heart-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
        filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.8));
    }
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.18); }
    40% { transform: scale(1); }
    60% { transform: scale(1.12); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- SVG Orbit Animations --- */
.logo-svg:hover .heart-core {
    fill: rgba(236, 72, 153, 0.1);
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 4px var(--quantum-pink));
}

/* ==========================================================================
   MEDIA QUERIES (Responsive Design)
   ========================================================================== */

@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-interactive {
        margin-top: 40px;
    }
    
    .sandbox-wrapper {
        grid-template-columns: 1fr;
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none; /* simple burger menu / hide logic if needed. Leaving simple for Claude polish */
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   LANGUAGE SWITCHER STYLES
   ========================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 24, 39, 0.6);
    align-items: center;
    height: 32px;
    padding: 2px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lang-btn {
    padding: 0 10px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    border-radius: 50px;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:focus-visible {
    outline: 2px solid var(--quantum-primary);
    outline-offset: 2px;
}

.lang-btn.active {
    background: rgba(139, 92, 246, 0.2);
    color: #e9d5ff; /* light purple text */
    border: 1.5px solid rgba(139, 92, 246, 0.35);
}

.lang-btn:hover:not(.active) {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   CONTACT BUTTONS STYLES
   ========================================================================== */
.about-contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-contact i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-contact:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.btn-contact:hover i {
    transform: scale(1.15);
}

/* Specific styling for WhatsApp button to make it pop with green glow */
.btn-contact.btn-whatsapp {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399; /* bright green */
}

.btn-contact.btn-whatsapp:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
    color: #34d399;
}

/* ==========================================================================
   ACCESSIBILITY UTILITIES
   ========================================================================== */

/* Visually hidden but accessible to screen readers.
   :focus-within/:active opt-out reveals skip links on focus. */
.visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--quantum-primary);
    color: white;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Global focus-visible for all interactive elements */
:where(a:any-link, button, [role="button"]):focus-visible {
    outline: 2px solid var(--quantum-primary);
    outline-offset: 3px;
}

/* ==========================================================================
   TYPOGRAPHY IMPROVEMENTS
   ========================================================================== */

h1, h2, h3 {
    text-wrap: balance;
}

p, .card-description, .about-text, .sandbox-desc {
    text-wrap: pretty;
}

.hero-title {
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   SCROLL-DOWN BOUNCE ANIMATION
   ========================================================================== */

@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

.scroll-arrow {
    animation: scroll-bounce 2s ease-in-out infinite;
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    html {
        scroll-behavior: auto;
    }

    .scroll-arrow {
        animation: none;
    }

    .formula-overlay {
        animation: none;
        opacity: 0.6;
    }

    .heart-core,
    .electron-1,
    .electron-2 {
        animation: none;
    }
}
