/* ========================================
   ML Partnership - Main Stylesheet
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: 1.3;
    color: #1a1f36;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    font-weight: 200;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

p {
    margin-bottom: 1.25rem;
    color: #5a6478;
    line-height: 1.9;
    font-weight: 300;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.logo a {
    color: #1a1f36;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

.logo span {
    color: #4f46e5;
    margin-left: 2px;
    font-weight: 300;
}

.nav-menu {
    display: flex;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #5a6478;
    font-weight: 400;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: #4f46e5;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #4f46e5;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2d3748;
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(180deg, #f8f9ff 0%, #e9e6ff 100%);
    overflow: hidden;
}

.hero .container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top center, rgba(79, 70, 229, 0.03) 0%, transparent 70%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: left;
    color: #1a1f36;
    max-width: 600px;
    flex: 1;
    padding: 3rem 0;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 200;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1a1f36 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    color: #5a6478;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    font-weight: 300;
    letter-spacing: 0.02em;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 0.95rem;
    font-weight: 400;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-align: center;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    transition: transform 0.5s ease;
}

.btn-primary:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
}

.btn-outline {
    background: transparent;
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.3);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: rgba(79, 70, 229, 0.5);
    transform: translateY(-2px);
}

/* Hero Image - Electric Grid */
.hero-image {
    flex: 1;
    max-width: 500px;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInRight 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}

.electric-grid-svg {
    width: 100%;
    height: auto;
}

.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animated nodes in electric grid */
.node {
    animation: pulse 2s ease-in-out infinite;
}

.node:nth-child(even) {
    animation-delay: 1s;
}

.flow-path {
    stroke-dasharray: 5 5;
    animation: dash 3s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

/* MISO Badge */
.miso-badge {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(79, 70, 229, 0.1);
    display: inline-block;
}

.badge-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.miso-logo {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.badge-text {
    font-size: 0.9rem;
    color: #5a6478;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Sections */
.section {
    padding: 6rem 0;
    position: relative;
}

.section:nth-child(even) {
    background: linear-gradient(180deg, #fafbff 0%, #f8f9ff 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    color: #1a1f36;
    margin-bottom: 1.25rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4f46e5, transparent);
}

.section-subtitle {
    color: #5a6478;
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    margin-top: 2rem;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-content h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.1);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.feature-icon svg {
    color: white;
}

.feature-card h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
    border-color: rgba(79, 70, 229, 0.1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    position: relative;
}

.service-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

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

.service-icon svg {
    color: white;
}

.service-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.service-card p {
    color: #718096;
    font-size: 0.95rem;
}

/* Expertise Section */
.expertise-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.expertise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.expertise-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.expertise-item h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.expertise-item p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.market-info {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.3);
}

.market-info h3 {
    color: white;
    margin-bottom: 1.5rem;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: white;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #4a5568;
}

.contact-item svg {
    color: #667eea;
    flex-shrink: 0;
}

.contact-form {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafbff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.05);
    background: white;
}

.form-group textarea {
    resize: vertical;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, #1a1f36 0%, #0f1219 100%);
    color: #cbd5e0;
    padding: 4rem 0 1.5rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.3), transparent);
}

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

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: #a0aec0;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #2d3748;
    color: #718096;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(79, 70, 229, 0.15);
    color: #1a1f36;
}

/* Custom scrollbar for Webkit browsers */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f8f9ff;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f46e5, #6366f1);
    border-radius: 6px;
    border: 3px solid #f8f9ff;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

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

    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }

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

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

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

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero-title {
        font-size: 2.75rem;
        font-weight: 200;
    }

    .hero-subtitle {
        font-size: 1.15rem;
        font-weight: 300;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-image {
        max-width: 100%;
        margin-top: 2rem;
    }

    .about-grid,
    .expertise-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }

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

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

    h2 {
        font-size: 2rem;
    }

    .section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
    }
}