/* ===== DESIGN TOKENS (MongoDB-inspired) ===== */
:root {
    /* Brand Colors */
    --brand-green: #00ed64;
    --brand-green-dark: #00684a;
    --brand-green-mid: #00a35c;
    --brand-green-soft: #c3f0d2;
    --brand-teal-deep: #001e2b;
    --brand-teal: #003d4f;
    --brand-teal-mid: #00684a;
    --accent-purple: #7b3ff2;
    --accent-orange: #fa6e39;
    --accent-pink: #f06bb8;

    /* Surfaces */
    --canvas: #ffffff;
    --canvas-dark: #001e2b;
    --surface: #011627;
    --surface-card: #0a2540;
    --surface-card-hover: #0e3054;

    /* Text */
    --ink: #001e2b;
    --on-dark: #ffffff;
    --on-dark-muted: #a8b3bc;
    --steel: #5c6c7a;

    /* Borders */
    --hairline: rgba(255,255,255,0.08);
    --hairline-strong: rgba(255,255,255,0.15);

    /* Spacing */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 16px;
    --sp-lg: 24px;
    --sp-xl: 32px;
    --sp-xxl: 48px;
    --sp-section: 80px;

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 100px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.3s;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--canvas-dark);
    color: var(--on-dark);
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    line-height: 1.6;
    position: relative;
}

a {
    color: var(--brand-green);
    text-decoration: none;
    transition: opacity var(--duration);
}

a:hover { opacity: 0.85; }

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0,237,100,0.08);
    padding: 2px 8px;
    border-radius: var(--r-sm);
    font-size: 0.85em;
    color: var(--brand-green);
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* ===== UTILITY ===== */
.green { color: var(--brand-green); }

/* ===== NAVIGATION ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 30, 43, 0.75);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--hairline);
    transition: all var(--duration);
}

.nav.scrolled {
    background: rgba(0, 30, 43, 0.95);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-lg);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--on-dark);
}

.nav-logo:hover { opacity: 1; }

.nav-logo-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-xl);
}

.nav-links a {
    color: var(--on-dark-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--duration);
}

.nav-links a:hover {
    color: var(--on-dark);
    opacity: 1;
}

.btn-pill-sm {
    background: var(--brand-green) !important;
    color: var(--ink) !important;
    padding: 8px 20px !important;
    border-radius: var(--r-full) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all var(--duration) var(--ease-out) !important;
}

.btn-pill-sm:hover {
    background: #00ff6e !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,237,100,0.3);
}

.nav-github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--on-dark-muted) !important;
    padding: 7px 14px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-full);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease-out);
}

.nav-github-link:hover {
    color: var(--on-dark) !important;
    border-color: var(--brand-green);
    background: rgba(0,237,100,0.06);
    transform: translateY(-1px);
}

.nav-github-link svg {
    flex-shrink: 0;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--on-dark);
    border-radius: 2px;
    transition: all var(--duration);
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px var(--sp-lg) var(--sp-section);
    max-width: 1200px;
    margin: 0 auto;
    gap: var(--sp-xxl);
}

.hero-content {
    flex: 1;
    max-width: 580px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    background: rgba(0,237,100,0.08);
    border: 1px solid rgba(0,237,100,0.2);
    padding: 6px 16px;
    border-radius: var(--r-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--brand-green);
    margin-bottom: var(--sp-lg);
    animation: fadeInUp 0.6s var(--ease-out);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-green);
    animation: pulse 2s ease-in-out infinite;
}

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

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: var(--sp-lg);
    animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--on-dark-muted);
    line-height: 1.7;
    margin-bottom: var(--sp-xl);
    animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-xl);
    animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    background: var(--brand-green);
    color: var(--ink);
    padding: 14px 32px;
    border-radius: var(--r-full);
    font-weight: 700;
    font-size: 1rem;
    transition: all var(--duration) var(--ease-out);
    border: none;
    cursor: pointer;
}

.btn-pill:hover {
    background: #00ff6e;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,237,100,0.3);
    color: var(--ink);
    opacity: 1;
}

.btn-pill-outline {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--on-dark);
    padding: 14px 32px;
    border-radius: var(--r-full);
    font-weight: 600;
    font-size: 1rem;
    border: 1.5px solid var(--hairline-strong);
    transition: all var(--duration) var(--ease-out);
    cursor: pointer;
}

.btn-pill-outline:hover {
    border-color: var(--brand-green);
    color: var(--brand-green);
    opacity: 1;
}

.btn-large {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.hero-install {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: 12px 16px;
    animation: fadeInUp 0.6s var(--ease-out) 0.4s both;
}

.code-badge {
    background: #cc3534;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    text-transform: uppercase;
    flex-shrink: 0;
}

.hero-install code {
    background: none;
    color: var(--on-dark-muted);
    font-size: 0.85rem;
    padding: 0;
    flex: 1;
    overflow-x: auto;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--on-dark-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--duration);
    flex-shrink: 0;
}

.copy-btn:hover {
    color: var(--brand-green);
    background: rgba(0,237,100,0.1);
}

/* ===== HERO VISUAL ===== */
.hero-visual {
    flex: 1;
    max-width: 500px;
    animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.topology-diagram {
    position: relative;
    background: linear-gradient(135deg, rgba(0,61,79,0.3), rgba(0,30,43,0.8));
    border: 1px solid var(--hairline);
    border-radius: var(--r-xl);
    padding: var(--sp-lg);
    overflow: hidden;
}

.topology-diagram::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0,237,100,0.04) 0%, transparent 60%);
    animation: rotateGlow 10s linear infinite;
}

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

.topo-svg {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
}

/* Topology lines */
.topo-line {
    stroke: rgba(0,237,100,0.25);
    stroke-width: 2;
    stroke-dasharray: 6 4;
    animation: dashFlow 2s linear infinite;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -20; }
}

.line-1 { animation-delay: 0s; }
.line-2 { animation-delay: 0.3s; }
.line-3 { animation-delay: 0.6s; }
.line-4 { animation-delay: 0.9s; }
.line-5 { animation-delay: 1.2s; }
.line-6 { animation-delay: 1.5s; }

/* Node styles */
.node-router .node-bg {
    fill: rgba(0,237,100,0.15);
    stroke: var(--brand-green);
    stroke-width: 1.5;
}

.node-switch .node-bg {
    fill: rgba(123,63,242,0.15);
    stroke: var(--accent-purple);
    stroke-width: 1.5;
}

.node-pc .node-bg {
    fill: rgba(250,110,57,0.15);
    stroke: var(--accent-orange);
    stroke-width: 1;
}

.node-label {
    fill: var(--on-dark);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
}

.node-type {
    fill: var(--on-dark-muted);
    font-family: 'Inter', sans-serif;
    font-size: 7px;
    text-anchor: middle;
}

/* AI scan pulse */
.ai-pulse {
    opacity: 0;
    animation: scanPulse 4s ease-out infinite;
}

.ai-pulse-2 {
    animation-delay: 1s;
}

@keyframes scanPulse {
    0% { r: 20; opacity: 0.6; }
    100% { r: 180; opacity: 0; }
}

/* Floating diagnosis badge */
.diagnosis-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0,30,43,0.95);
    border: 1px solid rgba(0,237,100,0.3);
    border-radius: var(--r-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
    animation: badgeSlide 1s var(--ease-out) 1.5s both;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

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

.diagnosis-icon { font-size: 1.2rem; }
.diagnosis-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand-green);
}
.diagnosis-detail {
    display: block;
    font-size: 0.7rem;
    color: var(--on-dark-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ===== STATS BAR ===== */
.stats-bar {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.stats-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-xl) var(--sp-lg);
    display: flex;
    justify-content: space-around;
    gap: var(--sp-lg);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--on-dark);
    letter-spacing: -1px;
}

.stat-suffix {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--on-dark);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--on-dark-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ===== SECTIONS COMMON ===== */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-section) var(--sp-lg);
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: var(--sp-xxl);
}

.section-tag {
    display: inline-block;
    background: rgba(0,237,100,0.08);
    color: var(--brand-green);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--r-full);
    margin-bottom: var(--sp-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: var(--sp-md);
}

.section-header p {
    color: var(--on-dark-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FEATURES ===== */
.features {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, var(--surface), var(--canvas-dark));
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-lg);
}

.feature-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-xl);
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.feature-card:hover {
    border-color: rgba(0,237,100,0.2);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

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

.feature-card-large {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    align-items: start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-md);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.icon-green { background: rgba(0,237,100,0.12); color: var(--brand-green); }
.icon-green svg { stroke: var(--brand-green); }
.icon-purple { background: rgba(123,63,242,0.12); color: var(--accent-purple); }
.icon-purple svg { stroke: var(--accent-purple); }
.icon-orange { background: rgba(250,110,57,0.12); color: var(--accent-orange); }
.icon-orange svg { stroke: var(--accent-orange); }
.icon-teal { background: rgba(0,163,92,0.12); color: var(--brand-green-mid); }
.icon-teal svg { stroke: var(--brand-green-mid); }
.icon-pink { background: rgba(240,107,184,0.12); color: var(--accent-pink); }
.icon-pink svg { stroke: var(--accent-pink); }

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--sp-sm);
}

.feature-card p {
    color: var(--on-dark-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== TERMINAL ANIMATION ===== */
.feature-terminal {
    background: #0d1117;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green-dot { background: #27c93f; }

.terminal-title {
    font-size: 0.75rem;
    color: var(--on-dark-muted);
    margin-left: 8px;
    font-weight: 500;
}

.terminal-body {
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    min-height: 160px;
}

.terminal-line {
    opacity: 0;
    transform: translateY(8px);
    animation: terminalType 0.4s var(--ease-out) forwards;
}

.terminal-line[data-delay="0"] { animation-delay: 0.5s; }
.terminal-line[data-delay="800"] { animation-delay: 1.3s; }
.terminal-line[data-delay="1600"] { animation-delay: 2.1s; }
.terminal-line[data-delay="2400"] { animation-delay: 2.9s; }
.terminal-line[data-delay="3200"] { animation-delay: 3.7s; }
.terminal-line[data-delay="4000"] { animation-delay: 4.5s; }

@keyframes terminalType {
    to { opacity: 1; transform: translateY(0); }
}

.t-prompt { color: var(--brand-green); }
.t-cmd { color: #79c0ff; }
.t-arg { color: var(--on-dark-muted); }
.t-output { color: #ffa657; }
.t-success { color: var(--brand-green); }

/* ===== HOW IT WORKS ===== */
.how-it-works {
    position: relative;
    z-index: 1;
}

.architecture-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--sp-section);
    flex-wrap: wrap;
}

.arch-node {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-xl) var(--sp-lg);
    text-align: center;
    min-width: 200px;
    transition: all 0.4s var(--ease-out);
}

.arch-node:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.arch-ai { border-color: rgba(0,237,100,0.2); }
.arch-mcp { border-color: rgba(123,63,242,0.2); }
.arch-pt { border-color: rgba(250,110,57,0.2); }

.arch-icon { font-size: 2rem; margin-bottom: var(--sp-sm); }

.arch-node h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.arch-node p {
    font-size: 0.8rem;
    color: var(--on-dark-muted);
    margin-bottom: var(--sp-sm);
}

.arch-badge {
    display: inline-block;
    background: rgba(0,237,100,0.1);
    color: var(--brand-green);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--r-full);
}

.badge-purple {
    background: rgba(123,63,242,0.1);
    color: var(--accent-purple);
}

.badge-orange {
    background: rgba(250,110,57,0.1);
    color: var(--accent-orange);
}

.arch-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 var(--sp-sm);
}

.arch-connector svg { width: 80px; }

.arch-protocol {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.protocol-purple { color: var(--accent-purple); }

/* Process Steps */
.process-steps {
    max-width: 700px;
    margin: 0 auto;
}

.process-step {
    display: flex;
    gap: var(--sp-xl);
    padding: var(--sp-xl) 0;
    border-bottom: 1px solid var(--hairline);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s var(--ease-out);
}

.process-step.visible {
    opacity: 1;
    transform: translateX(0);
}

.step-number {
    font-size: 2rem;
    font-weight: 900;
    color: rgba(0,237,100,0.15);
    min-width: 60px;
    font-family: 'JetBrains Mono', monospace;
}

.step-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-content p {
    color: var(--on-dark-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== SETUP ===== */
.setup {
    position: relative;
    z-index: 1;
    background: var(--surface);
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xxl);
}

.setup-prereq h3, .setup-config h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--sp-lg);
}

.prereq-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.prereq-item {
    display: flex;
    gap: var(--sp-md);
}

.prereq-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,237,100,0.1);
    color: var(--brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.prereq-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.prereq-item p {
    font-size: 0.85rem;
    color: var(--on-dark-muted);
    line-height: 1.5;
}

.setup-config p {
    color: var(--on-dark-muted);
    font-size: 0.95rem;
    margin-bottom: var(--sp-md);
}

/* Code Block */
.code-block {
    background: #0d1117;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: var(--sp-md);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.8rem;
    color: var(--on-dark-muted);
    font-family: 'JetBrains Mono', monospace;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    background: none;
    padding: 0;
    color: var(--on-dark);
    font-size: 0.85rem;
    line-height: 1.7;
    border-radius: 0;
}

.json-key { color: #79c0ff; }
.json-val { color: #a5d6ff; }

.setup-note {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    background: rgba(0,237,100,0.06);
    border: 1px solid rgba(0,237,100,0.15);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--on-dark-muted);
}

.note-icon { font-size: 1.1rem; }

/* ===== DEMO ===== */
.demo {
    position: relative;
    z-index: 1;
}

.demo-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
}

.demo-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    padding: var(--sp-xl);
    min-width: 260px;
    max-width: 300px;
    flex: 1;
}

.demo-step-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--sp-sm);
    color: var(--on-dark-muted);
}

.demo-icon { font-size: 1.5rem; margin-bottom: var(--sp-sm); }

.demo-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: var(--sp-sm);
}

.demo-card ul {
    list-style: none;
    margin-bottom: var(--sp-md);
}

.demo-card li {
    font-size: 0.85rem;
    color: var(--on-dark-muted);
    padding: 4px 0;
    line-height: 1.5;
}

.demo-fault { border-color: rgba(255,95,86,0.3); }
.demo-diagnosis { border-color: rgba(255,189,46,0.3); }
.demo-fixed { border-color: rgba(0,237,100,0.3); }

.bad { color: #ff5f56 !important; background: rgba(255,95,86,0.1); }
.good { color: var(--brand-green) !important; background: rgba(0,237,100,0.1); }

.demo-ping {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 6px 0;
    border-top: 1px solid var(--hairline);
}

.demo-ping span:first-child {
    color: var(--on-dark-muted);
    font-family: 'JetBrains Mono', monospace;
}

.ping-fail {
    color: #ff5f56;
    font-weight: 600;
    font-size: 0.75rem;
}

.ping-pass {
    color: var(--brand-green);
    font-weight: 600;
    font-size: 0.75rem;
}

.demo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.demo-arrow svg { width: 50px; }

.demo-arrow span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TOOLS GRID ===== */
.tools-section {
    position: relative;
    z-index: 1;
    background: var(--surface);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-md);
}

.tool-card {
    background: var(--surface-card);
    border: 1px solid var(--hairline);
    border-radius: var(--r-md);
    padding: var(--sp-xl);
    transition: all 0.3s var(--ease-out);
}

.tool-card:hover {
    border-color: rgba(0,237,100,0.2);
    transform: translateY(-2px);
}

.tool-emoji {
    font-size: 1.8rem;
    margin-bottom: var(--sp-sm);
}

.tool-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--on-dark-muted);
    line-height: 1.5;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== CTA ===== */
.cta {
    position: relative;
    z-index: 1;
}

.cta-content {
    text-align: center;
    background: linear-gradient(135deg, var(--brand-teal), rgba(0,237,100,0.08));
    border: 1px solid rgba(0,237,100,0.15);
    border-radius: var(--r-xl);
    padding: var(--sp-section) var(--sp-xl);
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: var(--sp-md);
}

.cta-content p {
    color: var(--on-dark-muted);
    font-size: 1.1rem;
    margin-bottom: var(--sp-xl);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    background: var(--canvas-dark);
    border-top: 1px solid var(--hairline);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-section) var(--sp-lg) var(--sp-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--sp-xxl);
    margin-bottom: var(--sp-xxl);
}

.footer-brand p {
    color: var(--on-dark-muted);
    font-size: 0.9rem;
    margin-top: var(--sp-md);
    max-width: 300px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.footer-links h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--sp-sm);
    color: var(--on-dark);
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--on-dark-muted);
    transition: color var(--duration);
}

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

.footer-bottom {
    text-align: center;
    padding-top: var(--sp-xl);
    border-top: 1px solid var(--hairline);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--on-dark-muted);
}

/* ===== SCROLL ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s var(--ease-out);
}

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

/* ===== RESPONSIVE DESIGN SYSTEM ===== */

/* Desktop & Large Tablets (<= 1024px) */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        padding-top: 100px;
        text-align: center;
        gap: var(--sp-xl);
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        max-width: 440px;
        width: 100%;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-card-large {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .setup-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-xl);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-xl);
    }
}

/* Tablets & Mobile Devices (<= 768px) */
@media (max-width: 768px) {
    /* Navbar & Mobile Overlay */
    .nav {
        height: 64px;
    }

    .nav-inner {
        padding: 0 var(--sp-md);
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(100vh - 64px);
        background: rgba(0, 30, 43, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        align-items: stretch;
        padding: var(--sp-xl) var(--sp-lg);
        gap: var(--sp-md);
        border-bottom: none;
        overflow-y: auto;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s var(--ease-out), opacity 0.3s ease;
        z-index: 999;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.05rem;
        padding: 12px 16px;
        border-radius: var(--r-md);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        text-align: center;
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--brand-green);
    }

    .nav-links .nav-github-link {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.95rem;
        border: 1px solid var(--hairline-strong);
    }

    .nav-links .btn-pill-sm {
        width: 100%;
        justify-content: center;
        padding: 13px 20px !important;
        font-size: 0.95rem !important;
        text-align: center;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Common Sections */
    .section-inner {
        padding: 60px var(--sp-md);
    }

    .section-header {
        margin-bottom: var(--sp-xl);
    }

    .section-header h2 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
    }

    .section-header p {
        font-size: 1rem;
    }

    /* Hero */
    .hero {
        padding: 88px var(--sp-md) 40px;
        min-height: auto;
        gap: 32px;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 2.8rem);
        letter-spacing: -0.8px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .hero-buttons {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }

    .hero-install {
        width: 100%;
        max-width: 480px;
    }

    /* Stats Bar */
    .stats-inner {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-lg);
        padding: var(--sp-xl) var(--sp-md);
    }

    .stat {
        min-width: 0;
    }

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

    .stat-suffix {
        font-size: 1.3rem;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--sp-md);
    }

    .feature-card {
        padding: var(--sp-lg);
    }

    .feature-card-large {
        grid-column: auto;
    }

    .feature-terminal {
        width: 100%;
    }

    .terminal-body {
        font-size: 0.78rem;
        overflow-x: auto;
    }

    /* Architecture Flow (Vertical Stacking) */
    .architecture-diagram {
        flex-direction: column;
        align-items: stretch;
        max-width: 360px;
        margin: 0 auto var(--sp-xl);
        gap: 0;
    }

    .arch-node {
        width: 100%;
        min-width: 0;
        padding: var(--sp-lg);
    }

    .arch-connector {
        transform: none !important;
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        gap: 4px;
        width: 100%;
    }

    .arch-connector .arch-arrow {
        display: flex;
        justify-content: center;
    }

    .arch-connector .arch-arrow svg {
        width: 22px;
        height: 32px;
        transform: rotate(90deg);
    }

    /* Process Steps */
    .process-step {
        gap: 16px;
        padding: 20px 0;
    }

    .step-number {
        font-size: 1.6rem;
        min-width: 48px;
    }

    /* Setup Guide */
    .setup-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .code-block pre {
        padding: 14px;
        font-size: 0.8rem;
        -webkit-overflow-scrolling: touch;
    }

    /* Demo Section (Vertical Stacking) */
    .demo-flow {
        flex-direction: column;
        align-items: stretch;
        max-width: 380px;
        margin: 0 auto;
        gap: 0;
    }

    .demo-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: var(--sp-lg);
    }

    .demo-arrow {
        transform: none !important;
        flex-direction: column;
        align-items: center;
        padding: 12px 0;
        gap: 4px;
        width: 100%;
    }

    .demo-arrow svg {
        width: 24px;
        height: 32px;
        transform: rotate(90deg);
    }

    .demo-arrow span {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    /* Tools Grid */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-md);
    }

    /* CTA Section */
    .cta-content {
        padding: 48px var(--sp-lg);
    }

    .cta-content h2 {
        font-size: 1.85rem;
    }

    .cta-content p {
        font-size: 0.95rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .cta-buttons a {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .footer-inner {
        padding: 48px var(--sp-md) var(--sp-lg);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
}

/* Mobile Phones (<= 480px) */
@media (max-width: 480px) {
    /* Navbar */
    .nav-inner {
        padding: 0 12px;
    }

    .nav-logo {
        font-size: 1rem;
        gap: 8px;
    }

    .nav-logo-icon {
        width: 24px;
        height: 24px;
    }

    /* Hero */
    .hero {
        padding: 76px 12px 28px;
        gap: 24px;
    }

    .hero-badge {
        font-size: 0.72rem;
        padding: 4px 12px;
        margin-bottom: 12px;
    }

    .hero-title {
        font-size: 1.85rem;
        letter-spacing: -0.5px;
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        line-height: 1.6;
        margin-bottom: 16px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        margin-bottom: 18px;
    }

    .hero-buttons .btn-pill,
    .hero-buttons .btn-pill-outline {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.92rem;
        text-align: center;
    }

    .hero-install {
        width: 100%;
        padding: 10px 12px;
        gap: 8px;
        justify-content: space-between;
        border-radius: var(--r-md);
    }

    .hero-install code {
        font-size: 0.68rem;
        max-width: calc(100% - 68px);
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .code-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    /* Topology Diagram & Badge */
    .topology-diagram {
        padding: 12px 8px;
        border-radius: var(--r-lg);
    }

    .diagnosis-badge {
        position: static !important;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.7rem;
        box-shadow: none;
        border-radius: var(--r-sm);
    }

    .diagnosis-icon {
        font-size: 1rem;
    }

    .diagnosis-title {
        font-size: 0.72rem;
    }

    .diagnosis-detail {
        font-size: 0.68rem;
    }

    /* Stats */
    .stats-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 20px 12px;
    }

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

    .stat-suffix {
        font-size: 1.15rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    /* Common Section */
    .section-inner {
        padding: 40px 12px;
    }

    .section-header {
        margin-bottom: 24px;
    }

    .section-tag {
        font-size: 0.72rem;
        padding: 4px 12px;
    }

    .section-header h2 {
        font-size: 1.65rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    /* Features & Terminal */
    .feature-card {
        padding: 18px 14px;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.88rem;
    }

    .terminal-header {
        padding: 8px 10px;
    }

    .terminal-title {
        font-size: 0.7rem;
    }

    .terminal-body {
        padding: 10px;
        font-size: 0.72rem;
        line-height: 1.6;
        min-height: 140px;
    }

    /* Setup Section */
    .setup-prereq h3,
    .setup-config h3 {
        font-size: 1.1rem;
        margin-bottom: 14px;
    }

    .prereq-list {
        gap: 14px;
    }

    .prereq-item {
        gap: 10px;
    }

    .prereq-icon {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .prereq-item h4 {
        font-size: 0.92rem;
    }

    .prereq-item p {
        font-size: 0.8rem;
    }

    .code-header {
        padding: 8px 10px;
        font-size: 0.72rem;
    }

    .code-block pre {
        padding: 10px;
        font-size: 0.72rem;
    }

    .setup-note {
        padding: 10px;
        font-size: 0.75rem;
    }

    /* Demo Section */
    .demo-card {
        padding: 18px 14px;
    }

    .demo-card h4 {
        font-size: 0.95rem;
    }

    .demo-card li {
        font-size: 0.78rem;
    }

    .demo-ping {
        font-size: 0.75rem;
    }

    /* Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tool-card {
        padding: 16px 14px;
    }

    .tool-card h4 {
        font-size: 0.95rem;
    }

    .tool-card p {
        font-size: 0.78rem;
    }

    /* CTA */
    .cta-content {
        padding: 28px 12px;
        border-radius: var(--r-md);
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 0.88rem;
    }

    /* Footer */
    .footer-inner {
        padding: 40px 12px 18px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 24px;
    }

    .footer-brand p {
        font-size: 0.85rem;
    }

    .footer-links a {
        font-size: 0.82rem;
        padding: 4px 0;
    }

    .footer-bottom p {
        font-size: 0.78rem;
    }
}
