/* --- Reset & Variables --- */
:root {
    --bg: #050505;
    --surface: #0a0a0c;
    --card-bg: rgba(255, 255, 255, 0.02);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; color: var(--text-main); }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1rem;
    display: inline-block;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hides newline when mobile view */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(5, 5, 5, 0.7);
    border-bottom: 1px solid var(--border);
}

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

/* --- Navigation & Footer Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.logo-icon {
    position: relative; /* Required for the dot positioning */
    width: 20px; 
    height: 20px;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    border-radius: 5px;
    box-shadow: 0 0 14px var(--accent-glow);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Subtle scale on hover for the whole logo mark */
.logo:hover .logo-icon {
    transform: scale(1.04);
}

/* The fancy top-right dot */
.logo-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    animation: dot-pulse 5s infinite ease-in-out;
}

/* Soft, slow pulse for the dot to make it feel "alive" */
@keyframes dot-pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.5; 
        transform: scale(0.75); 
    }
}

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text-main); }

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

/* --- Hero --- */
.hero {
    position: relative;
    padding: 10rem 0 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.grid-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 20%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

#networkCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.hero-content {
    text-align: center;
    max-width: 820px;
    z-index: 2;
    position: relative;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pulse {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 3rem;
}

.cta-group { display: flex; gap: 1rem; justify-content: center; }

.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--text-main);
    color: var(--bg);
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

/* --- Concept Diagram --- */
.concept-diagram {
    margin-top: 5rem;
    padding: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    z-index: 2;
    position: relative;
}

.diagram-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-align: center;
}

.diagram-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.node {
    padding: 1.5rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    min-width: 130px;
    transition: all 0.3s ease;
}

.node:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.node-icon {
    width: 40px; height: 40px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.node-icon svg { width: 20px; height: 20px; }

.node-icon.glow {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}

.node-label {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.node-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.node-engine {
    border-color: rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0.02));
}

.node-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.node-client {
    padding: 0.75rem 1.25rem;
    min-width: 110px;
}

.connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.connector .line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.connector-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Problem Section --- */
.problem { padding: 8rem 0; }

.section-header { text-align: center; max-width: 640px; margin: 0 auto 5rem; }
.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}
.section-desc { color: var(--text-muted); font-size: 1.1rem; }

.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.problem-card {
    position: relative;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.problem-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        400px circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.04),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.problem-card:hover { border-color: var(--border-hover); }
.problem-card:hover::before { opacity: 1; }

.problem-number {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.problem-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

.problem-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* --- Features --- */
.features { padding: 8rem 0; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.glass-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        500px circle at var(--mouse-x) var(--mouse-y),
        rgba(14, 165, 233, 0.12),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

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

.card-icon {
    width: 48px; height: 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}
.card-icon svg { width: 24px; height: 24px; }

.glass-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.glass-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* --- How it Works --- */
.how-it-works {
    padding: 8rem 0;
    background: linear-gradient(180deg, transparent 0%, rgba(14, 165, 233, 0.02) 50%, transparent 100%);
}

.terminal {
    margin: 0 auto 5rem;
    max-width: 820px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
    padding: 0;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.8;
}

.prompt { color: #10b981; }
.cmd { color: #60a5fa; }
.output { color: var(--text-muted); }
.success { color: var(--accent); }
.highlight { color: var(--text-main); }

.cursor { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: left;
}

.step-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.step h4 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Use Cases --- */
.usecases { padding: 8rem 0; }

.usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 5rem;
}

.usecase-card {
    position: relative;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.usecase-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        400px circle at var(--mouse-x) var(--mouse-y),
        rgba(14, 165, 233, 0.1),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.usecase-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}
.usecase-card:hover::before { opacity: 1; }

.usecase-icon {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.usecase-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

.usecase-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    text-align: center;
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item h4 {
    font-size: 3.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Final CTA --- */
.final-cta { padding: 6rem 0 8rem; }

.cta-box {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(59, 130, 246, 0.02));
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.1), transparent 50%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cta-box h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    position: relative;
}

.cta-box p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    position: relative;
}

.cta-box .cta-group { position: relative; }

/* --- Footer --- */
.footer {
    padding: 4rem 0 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-left { max-width: 300px; }

.footer-desc {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

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

.footer-col h5 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.2rem;
    color: var(--text-main);
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--text-main); }

.copyright {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 7rem 0 3rem; }
    .footer-container { flex-direction: column; gap: 2rem; }
    .footer-links { gap: 2rem; flex-wrap: wrap; }
    .concept-diagram { padding: 1.5rem; }
    .diagram-flow { flex-direction: column; }
    .connector { transform: rotate(90deg); }
    .node-group { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .terminal-body { font-size: 0.72rem; }
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 2rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    background: linear-gradient(180deg, rgba(15, 15, 20, 0.95), rgba(10, 10, 12, 0.98));
    border: 1px solid var(--border-hover);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 
        0 0 0 1px rgba(14, 165, 233, 0.1),
        0 0 60px -10px rgba(14, 165, 233, 0.25),
        0 30px 60px -20px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* Subtle animated glow behind the modal */
.modal::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px;
    right: -2px; bottom: -2px;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(14, 165, 233, 0.3) 60deg,
        transparent 120deg,
        rgba(59, 130, 246, 0.2) 240deg,
        transparent 360deg
    );
    border-radius: 20px;
    z-index: -1;
    animation: modal-glow 12s linear infinite;
    opacity: 0.6;
}

@keyframes modal-glow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.modal-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.2);
}

.modal-icon svg {
    width: 28px;
    height: 28px;
}

.modal h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.modal-text {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.modal-email {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-email:hover {
    background: rgba(14, 165, 233, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.15);
    color: var(--accent);
}

.modal-email svg {
    width: 18px;
    height: 18px;
}

/* Ensure buttons behave as buttons when used as modal triggers */
.modal-trigger {
    cursor: pointer;
}