/* --- flowand.ai - Global Styles & Variables --- */
:root {
    --core-navy: #0A192F;
    --deep-space: #03070E;
    --electric-mint: #00F5D4;
    --graphite-grey: #3F4E66;
    --slate: #B0BCCB;
    --white: #FFFFFF;
    --font-main: 'Inter Tight', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --nav-height: 64px; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--core-navy);
    color: var(--white);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        linear-gradient(rgba(0, 245, 212, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center center;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 40%, rgba(0, 245, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: pulseGlow 10s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    from { opacity: 0.5; transform: scale(1); }
    to { opacity: 1; transform: scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
}

.accent { color: var(--electric-mint); }

.mono-label {
    font-family: var(--font-mono);
    color: var(--electric-mint);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
}

.section-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 3rem;
    text-align: center;
}

.main-text {
    font-size: 1.15rem;
    color: var(--slate);
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: center;
}

.navbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(10, 25, 47, 0.7);
    backdrop-filter: blur(16px);
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
}

.main-logo {
    height: 30px;
    width: auto;
    display: block;
}

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

.nav-links a {
    color: var(--slate);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover { color: var(--electric-mint); }

.btn {
    padding: 0.75rem 1.8rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.btn-primary {
    background: var(--electric-mint);
    color: var(--core-navy);
    border: 1px solid var(--electric-mint);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.4), 0 0 40px rgba(0, 245, 212, 0.1);
}

.btn-secondary {
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.03);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
}

.cta-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.hero {
    padding: calc(var(--nav-height) + 4rem) 0 8rem; 
    text-align: center;
    position: relative;
}

.hero-headline {
    font-size: clamp(3rem, 8vw, 5.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: normal;
}

.hero-subheadline {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    max-width: 750px;
    margin: 0 auto 2rem;
    line-height: 1.5;
    color: var(--white);
    font-weight: 400;
}

.supporting-text {
    color: var(--slate);
    max-width: 580px;
    margin: 0 auto 3rem;
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.8;
}

.section { padding: 6rem 0; }

.grid {
    display: grid;
    gap: 2rem;
}

.cards {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2-col {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
    margin: 0 auto;
}

.card {
    background: rgba(255,255,255,0.02);
    padding: 2.5rem;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    transition: 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--electric-mint), transparent);
    opacity: 0;
    transition: 0.4s;
}

.card:hover {
    border-color: rgba(0, 245, 212, 0.3);
    background: rgba(255,255,255,0.04);
    transform: translateY(-5px);
}

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

.card h3, .card h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.card p {
    color: var(--slate);
    font-size: 1rem;
}

.architecture-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 3rem;
}

.arch-card {
    border-left: 4px solid var(--electric-mint);
    padding: 2rem;
    background: rgba(255,255,255,0.02);
    transition: 0.3s;
    border-radius: 0 16px 16px 0;
}

.arch-card p { color: var(--slate); }

.arch-card:hover { background: rgba(0, 245, 212, 0.04); }

.compliance-grid {
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.comp-item { padding: 1.5rem; }

.comp-item h4 {
    color: var(--electric-mint);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.comp-item p { color: var(--slate); }

.table-wrapper {
    overflow-x: auto;
    margin-top: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--deep-space);
}

.comparison-table th, .comparison-table td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.comparison-table th {
    background: rgba(255,255,255,0.02);
    font-size: 1.05rem;
    font-weight: 600;
}

.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table th.highlight, .comparison-table td:last-child {
    color: var(--electric-mint);
    background: rgba(0, 245, 212, 0.03);
}

.bottom-statement {
    text-align: center;
    margin-top: 4rem;
    font-size: 1.25rem;
}

.bottom-statement strong { color: var(--white); }

.final-cta {
    text-align: center;
    background: var(--deep-space);
    padding: 8rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.final-cta h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    max-width: 800px;
    margin: 0 auto 1.5rem;
}

.final-cta p {
    color: var(--slate);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.footer {
    padding: 4rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo {
    height: 28px;
    width: auto;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.8;
}

.footer-brand p {
    color: var(--slate);
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    opacity: 0.6;
    transition: 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--electric-mint);
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(3, 7, 14, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--core-navy);
    border: 1px solid rgba(0, 245, 212, 0.2);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.modal-overlay.is-open .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
    color: var(--white);
}

.modal-close {
    background: none;
    border: none;
    color: var(--slate);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--electric-mint);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    color: var(--slate);
    font-size: 0.95rem;
    line-height: 1.7;
}

.modal-body h3 {
    color: var(--white);
    margin: 2rem 0 0.5rem;
    font-size: 1.1rem;
}

.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 1rem; }
.modal-body ul { margin-left: 1.5rem; margin-bottom: 1.5rem; }
.modal-body li { margin-bottom: 0.3rem; }
.modal-body strong { color: var(--white); }

body.modal-open {
    overflow: hidden;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero-headline { font-size: 4rem; }
}

@media (max-width: 768px) {
    /* Navbar: Piilotetaan tekstit, mutta pidetään Demo-nappi */
    .navbar .nav-links { display: none; } 
    .navbar .nav-cta { 
        display: flex; 
        padding: 0.5rem 1.2rem; 
        font-size: 0.85rem; 
    }
    
    /* Yleiset etäisyydet mobiilissa */
    .section { padding: 4rem 0; }
    .hero { padding: calc(var(--nav-height) + 2rem) 0 4rem; }
    .hero-headline { font-size: 2.8rem; }
    .section-title { font-size: 2.2rem; }

    /* Pakotetaan kaikki gridit 1-sarakkeiseksi putkeksi */
    .grid-2-col, 
    .cards, 
    .architecture-grid, 
    .compliance-grid {
        grid-template-columns: 1fr;
    }

    /* Korjataan arkkitehtuurikorttien visuaalisuus pinottuna */
    .arch-card {
        border-left: none;
        border-top: 4px solid var(--electric-mint);
        border-radius: 16px;
    }

    /* Napit koko leveyteen */
    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 2rem auto 0;
    }
    .btn { width: 100%; }
    
    /* Footer siistiksi */
    .footer .container {
        flex-direction: column;
        text-align: left;
    }
    .footer-brand, .footer-links {
        width: 100%;
    }
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Modaalien hienosäätö mobiilille */
    .modal-body { padding: 1.5rem; }
    .modal-header { padding: 1.2rem 1.5rem; }
}