/* ─── Nyquest.ai Design System ─── */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Outfit:wght@200;300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b0e;
    --bg-secondary: #111318;
    --bg-card: #161821;
    --bg-card-hover: #1a1d28;
    --border: #1e2130;
    --border-accent: #2a3050;
    --text-primary: #e8eaf0;
    --text-secondary: #8890a8;
    --text-dim: #505670;
    --accent: #4fd1c5;
    --accent-glow: rgba(79, 209, 197, 0.15);
    --accent-bright: #7ee8de;
    --signal: #c084fc;
    --signal-glow: rgba(192, 132, 252, 0.12);
    --danger: #fc8181;
    --purple: #a78bfa;
    --cyan: #22d3ee;
    --cyan-glow: rgba(34, 211, 238, 0.12);
    --green: #68d391;
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'DM Mono', 'Fira Code', monospace;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
}

/* ─── Nav ─── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 1.2rem 3rem;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(10, 11, 14, 0.88);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.logo { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 500; color: var(--accent); letter-spacing: 0.08em; text-decoration: none; display: inline-flex; align-items: baseline; line-height: 1; }
.logo span { color: var(--text-dim); font-weight: 300; font-size: inherit; line-height: 1; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.86rem; font-weight: 400; letter-spacing: 0.02em; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent); }
.nav-discord { padding: 0.45rem 1rem !important; background: #5865F2 !important; color: #fff !important; border-radius: 6px; font-weight: 500 !important; font-size: 0.82rem !important; display: inline-flex !important; align-items: center; gap: 0.35rem; }
.nav-discord::before { content: ''; display: inline-block; width: 16px; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%23fff' d='M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0 105.89 105.89 0 0 0 19.39 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53.12s5-12.59 11.45-12.59 11.68 5.71 11.45 12.59c-.1 6.87-5.13 12.57-11.45 12.57Zm42.24 0C78.41 65.69 73.25 60 73.25 53.12s5-12.59 11.44-12.59 11.68 5.71 11.45 12.59c0 6.87-5.12 12.57-11.45 12.57Z'/%3E%3C/svg%3E") no-repeat center/contain; }
.nav-discord:hover { background: #4752C4 !important; box-shadow: 0 0 15px rgba(88,101,242,0.4); }
.nav-chrome { padding: 0.45rem 1rem !important; background: rgba(79,209,197,0.12) !important; color: var(--accent) !important; border: 1px solid rgba(79,209,197,0.3); border-radius: 6px; font-weight: 500 !important; font-size: 0.82rem !important; }
.nav-chrome:hover { background: rgba(79,209,197,0.22) !important; border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); color: var(--accent-bright) !important; }
.nav-chrome svg { stroke: var(--accent); }
.nav-cta { padding: 0.45rem 1.2rem !important; background: var(--accent) !important; color: var(--bg-primary) !important; border-radius: 6px; font-weight: 500 !important; }
.nav-cta:hover { background: var(--accent-bright) !important; box-shadow: 0 0 20px var(--accent-glow); }

/* ─── Section System ─── */
section { padding: 6rem 3rem; }
.section-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--signal); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1rem; }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 600; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; font-weight: 600; line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 500; margin-bottom: 0.6rem; }
.accent { color: var(--accent); }
.dim { color: var(--text-secondary); font-weight: 300; }
.section-sub { color: var(--text-secondary); font-size: 1.05rem; max-width: 560px; margin-bottom: 3rem; }

/* ─── Buttons ─── */
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 2rem; background: var(--accent); color: var(--bg-primary); font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.25s; }
.btn-primary:hover { background: var(--accent-bright); box-shadow: 0 0 30px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.3); transform: translateY(-1px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 2rem; background: transparent; color: var(--text-primary); font-family: var(--font-display); font-size: 0.95rem; font-weight: 400; border: 1px solid var(--border-accent); border-radius: 8px; cursor: pointer; text-decoration: none; transition: all 0.25s; }
.btn-secondary:hover { border-color: var(--text-secondary); background: var(--bg-card); }
.btn-sm { padding: 0.55rem 1.2rem; font-size: 0.85rem; }

/* ─── Cards ─── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; transition: all 0.3s; }
.card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.card-icon { font-size: 1.6rem; margin-bottom: 1rem; }
.card-title { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.5rem; }
.card-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* ─── Grid System ─── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; max-width: 1100px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 1100px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; max-width: 1100px; }
.grid-5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; max-width: 1200px; }

/* ─── Stats Bar ─── */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem; background: var(--bg-secondary); }
.stat { text-align: center; }
.stat-value { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 500; color: var(--accent); }
.stat-label { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.3rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* ─── Code Block ─── */
.code-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem 1.5rem; margin: 1rem 0 1.5rem; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.8; color: var(--text-secondary); overflow-x: auto; white-space: pre; }
.code-block .comment { color: var(--text-dim); }
.code-block .key { color: var(--signal); }
.code-block .value { color: var(--accent); }
.code-block .string { color: var(--purple); }
code { font-family: var(--font-mono); font-size: 0.82rem; background: var(--bg-card); padding: 0.15rem 0.5rem; border-radius: 4px; border: 1px solid var(--border); }

/* ─── Badge ─── */
.badge { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; padding: 0.3rem 0.9rem; border-radius: 16px; letter-spacing: 0.06em; }
.badge-signal { color: var(--signal); border: 1px solid rgba(246, 173, 85, 0.25); background: var(--signal-glow); }
.badge-accent { color: var(--accent); border: 1px solid rgba(79, 209, 197, 0.25); background: var(--accent-glow); }
.badge-green { color: var(--green); border: 1px solid rgba(104, 211, 145, 0.25); background: rgba(104, 211, 145, 0.1); }
.badge-purple { color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.25); background: rgba(167, 139, 250, 0.1); }

/* ─── Architecture Diagram ─── */
.arch-diagram { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; font-family: var(--font-mono); font-size: 0.78rem; line-height: 2; color: var(--text-secondary); overflow-x: auto; white-space: pre; max-width: 700px; }
.arch-diagram .highlight { color: var(--accent); }
.arch-diagram .arrow { color: var(--signal); }
.arch-diagram .dim { color: var(--text-dim); }

/* ─── Table ─── */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.88rem; }
th { text-align: left; padding: 0.7rem 1rem; border-bottom: 2px solid var(--border); font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }

/* ─── Section Alt ─── */
.section-alt { background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ─── Page Header ─── */
.page-header { padding: 8rem 3rem 3rem; }
.page-header h1 { margin-bottom: 0.5rem; }

/* ─── Footer ─── */
footer { border-top: 1px solid var(--border); padding: 2.5rem 3rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--text-dim); }
footer a { color: var(--text-secondary); text-decoration: none; margin-right: 1.5rem; }
footer a:hover { color: var(--text-primary); }

/* ─── Animations ─── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.7s ease-out forwards; opacity: 0; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.2s; }


/* ─── Mobile Hamburger Menu ─── */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; z-index: 110; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: all 0.3s; border-radius: 1px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    /* Nav — Mobile Hamburger */
    nav { padding: 0.8rem 1rem; gap: 0.5rem; }
    .hamburger { display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
        background: var(--bg-secondary); border-left: 1px solid var(--border);
        flex-direction: column; align-items: flex-start; justify-content: flex-start;
        padding: 5rem 2rem 2rem; gap: 0; z-index: 105;
        transition: right 0.3s ease;
    }
    .nav-links.open { right: 0; }
    .nav-links a { display: block !important; font-size: 1rem; padding: 0.8rem 0; width: 100%; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a.active { color: var(--accent); }
    .nav-discord { margin-top: 0.5rem !important; padding: 0.6rem 1.5rem !important; font-size: 0.9rem !important; text-align: center !important; border-radius: 6px; width: 100%; display: flex !important; justify-content: center; }
    .nav-cta { margin-top: 0.5rem !important; padding: 0.6rem 1.5rem !important; font-size: 0.9rem !important; text-align: center !important; border-radius: 6px; width: 100%; display: block !important; }
    .nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 104; }
    .nav-overlay.open { display: block; }
    .logo { font-size: 1.1rem; letter-spacing: 0.04em; }

    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    /* Sections */
    section { padding: 3.5rem 1.2rem; }
    .page-header { padding: 5.5rem 1.2rem 2rem; }
    .section-sub { font-size: 0.95rem; }

    /* Hero — stack vertically on mobile */
    section.page-header[style*="flex-direction:row"],
    section[style*="flex-direction:row"] {
        flex-direction: column !important;
        text-align: center;
    }
    section[style*="flex-direction:row"] .section-sub { margin: 0 auto 2rem; }
    section[style*="flex-direction:row"] div[style*="flex:1"][style*="justify-content:center"] {
        display: none !important;
    }
    section[style*="flex-direction:row"] div[style*="flex-wrap:wrap"] {
        justify-content: center;
    }

    /* Stats */
    .stats-bar { grid-template-columns: repeat(2, 1fr); padding: 2rem 1.2rem; gap: 1.2rem; }
    .stat-value { font-size: 1.6rem; }

    /* Grids — single column */
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }

    /* Tables — scrollable */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 0.8rem; }
    th, td { padding: 0.5rem 0.7rem; white-space: nowrap; }

    /* Code blocks */
    .code-block, .arch-diagram { font-size: 0.72rem; padding: 1rem; }

    /* Live telemetry stat pills — force 2-col on mobile */
    #openclaw-live-section div[style*="grid-template-columns:repeat(4,1fr)"],
    div[style*="grid-template-columns:repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Live section padding */
    #openclaw-live-section { padding: 1.2rem !important; }

    /* Shrink stat numbers inside live pills so they fit 2-col */
    #openclaw-live-section div[style*="font-size:1.6rem"] {
        font-size: 1.2rem !important;
    }

    /* Chart container — reduce left padding for y-axis labels */
    #openclaw-live-section div[style*="position:relative"][style*="height:180px"] {
        padding-left: 2.2rem !important;
        height: 150px !important;
    }

    /* Roadmap 2-col grid inside vision card */
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Vision card padding */
    div[style*="border-radius:16px"][style*="padding:3rem"] {
        padding: 1.5rem !important;
    }

    /* Footer */
    footer { flex-direction: column; gap: 1rem; text-align: center; padding: 2rem 1.2rem; }
    footer a { margin-right: 0.8rem; }

    /* Buttons */
    .btn-primary, .btn-secondary { padding: 0.75rem 1.5rem; font-size: 0.88rem; }
}
