/* =============================================
   CSS Variables and Reset
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0a0e27;
    --primary-blue: #1e3a8a;
    --accent-cyan: #22d3ee;
    --accent-orange: #ff6b35;
    --accent-pink: #ec4899;
    --text-light: #ffffff;
    --text-gray: #94a3b8;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #22d3ee 0%, #1e3a8a 100%);
    --gradient-3: linear-gradient(135deg, #ff6b35 0%, #ec4899 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =============================================
   Navigation
   ============================================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(34, 211, 238, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* Animated Logo Styles */
.logo-animated-matrix {
    position: relative;
    width: 50px;  /* Base size for nav; scale for other uses */
    height: 50px;
    display: inline-block;  /* Ensures it fits inline */
}

.matrix-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;  /* Scales with parent if using transform: scale() */
    font-weight: bold;
    color: var(--accent-cyan);
    z-index: 3;
}

.matrix-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotateRing 15s linear infinite;  /* Slow rotation for animation */
}

.ring-1 span {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 14px;  /* Scales with parent */
    color: var(--accent-pink);
    transform: translate(-50%, -50%) rotate(calc(90deg * (var(--i) - 1))) translateY(-40%) rotate(calc(-90deg * (var(--i) - 1)));  /* Circular positioning */
}

.ring-1 span:nth-child(1) { --i: 1; }
.ring-1 span:nth-child(2) { --i: 2; }
.ring-1 span:nth-child(3) { --i: 3; }
.ring-1 span:nth-child(4) { --i: 4; }

.ring-2 span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;  /* Scales with parent */
    height: 4px;
    background: var(--accent-orange);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(calc(90deg * (var(--i) - 1))) translateY(-60%) rotate(calc(-90deg * (var(--i) - 1)));  /* Outer ring */
}

.ring-2 span:nth-child(1) { --i: 1; }
.ring-2 span:nth-child(2) { --i: 2; }
.ring-2 span:nth-child(3) { --i: 3; }
.ring-2 span:nth-child(4) { --i: 4; }

@keyframes rotateRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Update logo hover to affect the new animated logo */
.logo:hover .logo-animated-matrix {
    filter: drop-shadow(0 0 20px rgba(34, 211, 238, 0.5));
    transform: scale(1.05);
}

.logo:hover .logo-img {
    filter: drop-shadow(0 0 20px rgba(34, 211, 238, 0.5));
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: none; /* Hide on mobile, show on desktop */
}

@media (min-width: 768px) {
    .logo-text {
        display: block;
    }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-cyan);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.cta-button {
    background: var(--gradient-2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.3);
}

/* =============================================
   Hero Section
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 2rem 2rem;
    background: radial-gradient(circle at 20% 50%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #22d3ee 0%, #ec4899 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease;
}

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

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-2);
    color: white;
}

.btn-secondary {
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(34, 211, 238, 0.3);
}

.btn-secondary:hover {
    background: var(--accent-cyan);
    color: var(--primary-dark);
}

.hero-visual {
    position: relative;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.math-animation {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.floating-icons {
    position: absolute;
    font-size: 2rem;
    color: var(--accent-cyan);
    animation: floatAround 10s ease-in-out infinite;
}

.floating-icons:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-icons:nth-child(2) { top: 20%; right: 15%; animation-delay: 2s; }
.floating-icons:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 4s; }
.floating-icons:nth-child(4) { bottom: 10%; right: 10%; animation-delay: 6s; }

@keyframes floatAround {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(90deg); }
    50% { transform: translate(-20px, 20px) rotate(180deg); }
    75% { transform: translate(-30px, -10px) rotate(270deg); }
}

/* =============================================
   Features Section
   ============================================= */
.features {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0f1729 100%);
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    text-align: center;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-cyan);
    box-shadow: 0 20px 40px rgba(34, 211, 238, 0.2);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--gradient-2);
    border-radius: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

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

.feature-card ul {
    list-style: none;
    margin-top: 1rem;
}

.feature-card ul li {
    color: var(--text-gray);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card ul li::before {
    content: "✓";
    color: var(--accent-cyan);
    font-weight: bold;
}

/* =============================================
   Products Section
   ============================================= */
.products {
    padding: 5rem 2rem;
    background: var(--primary-dark);
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
}

.product-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

.product-showcase:nth-child(even) {
    direction: rtl;
}

.product-showcase:nth-child(even) .product-info {
    direction: ltr;
}

.product-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.product-info p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.product-visual {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.product-visual::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* =============================================
   Contact Section
   ============================================= */
.contact {
    padding: 5rem 2rem;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #0a0e27 100%);
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    background: rgba(30, 58, 138, 0.1);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    background: rgba(10, 14, 39, 0.5);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 10px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.05);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-2);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(34, 211, 238, 0.3);
}

/* =============================================
   Footer
   ============================================= */
footer {
    padding: 3rem 2rem;
    background: #050814;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-cyan);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-cyan);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
    color: var(--text-gray);
}

/* =============================================
   Mobile Responsiveness
   ============================================= */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--accent-cyan);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 14, 39, 0.98);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .product-showcase {
        grid-template-columns: 1fr;
    }

    .product-showcase:nth-child(even) {
        direction: ltr;
    }
}

/* =============================================
   Animations on scroll
   ============================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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