/* =============================================
   VibeGravityKit Docs — Design Contract
   Primary: #3B82F6  Accent: #8B5CF6
   ============================================= */

:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --accent: #8B5CF6;
    --green: #10B981;
    --bg: #FFFFFF;
    --bg-alt: #F8FAFC;
    --surface: #F1F5F9;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --code-bg: #F1F5F9;
    --code-text: #1E293B;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-w: 1100px;
    --radius: 12px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --bg: #0B1120;
    --bg-alt: #111827;
    --surface: #1E293B;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: #1E293B;
    --code-bg: #1E293B;
    --code-text: #E2E8F0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(11, 17, 32, 0.85);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--mono);
    font-size: 0.875em;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: 64px;
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.nav-gh {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-gh svg {
    opacity: 0.7;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.theme-btn:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.lang-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font);
    transition: all 0.2s;
    margin-left: 0.5rem;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ========== HERO ========== */
.hero {
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== SECTIONS ========== */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

/* ========== FEATURES ========== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    box-shadow: var(--card-shadow);
}

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

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

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

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.925rem;
    margin-bottom: 0.75rem;
}

.feature-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.feature-badge.green {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.feature-badge.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.feature-badge.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
}

[data-theme="dark"] .feature-badge.green {
    color: #34D399;
}

[data-theme="dark"] .feature-badge.blue {
    color: #60A5FA;
}

[data-theme="dark"] .feature-badge.purple {
    color: #A78BFA;
}

/* ========== MODES ========== */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.mode-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

.mode-card-highlight {
    border-color: var(--primary);
    position: relative;
}

.mode-card-highlight::before {
    content: 'Recommended';
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary);
    color: #fff;
    padding: 2px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mode-header {
    margin-bottom: 1rem;
}

.mode-emoji {
    font-size: 2rem;
}

.mode-header h3 {
    font-size: 1.25rem;
    margin: 0.4rem 0;
}

.mode-header code {
    background: var(--surface);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary);
}

.mode-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.mode-example {
    margin-bottom: 1rem;
}

.mode-example strong {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.code-block {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    overflow-x: auto;
    border: 1px solid var(--border);
}

pre.code-block {
    white-space: pre;
}

pre.code-block code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
    z-index: 2;
    opacity: 0;
}

pre.code-block:hover .copy-btn,
.ide-card:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--bg);
}

.copy-btn.copied {
    color: var(--green);
    border-color: var(--green);
    opacity: 1;
}

.mode-features {
    list-style: none;
}

.mode-features li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ========== INSTALL ========== */
.install-steps {
    margin-bottom: 3rem;
}

.step {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.step-content h4 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.step-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.step-note code {
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.ide-support {
    margin-top: 2rem;
}

.ide-support h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.ide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.ide-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ide-card strong {
    font-size: 0.95rem;
}

.ide-card code {
    font-size: 0.8rem;
    color: var(--primary);
}

/* ========== TEAM PROFILES ========== */
.callout {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.callout-problem {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.callout-solution {
    color: var(--text);
    font-size: 0.95rem;
}

.subsection {
    margin-bottom: 2.5rem;
}

.subsection h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.subsection-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Trigger cards */
.trigger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
}

.trigger-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.trigger-card strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.trigger-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

.trigger-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
}

.trigger-dot.blue {
    background: #3B82F6;
}

.trigger-dot.green {
    background: #10B981;
}

.trigger-dot.red {
    background: #EF4444;
}

.trigger-dot.yellow {
    background: #F59E0B;
}

/* Detect grid */
.detect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.detect-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
}

.detect-item strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.detect-item span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Memory cards */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.memory-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.memory-card.hot {
    border-top: 3px solid #EF4444;
}

.memory-card.warm {
    border-top: 3px solid #F59E0B;
}

.memory-card.cold {
    border-top: 3px solid #3B82F6;
}

.memory-tier {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.memory-card h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.memory-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.memory-cost {
    display: inline-block;
    background: var(--surface);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text-muted);
}

/* Dedup flow */
.dedup-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dedup-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.dedup-step span {
    display: block;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.dedup-arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

.dedup-example {
    font-family: var(--mono);
    font-size: 0.8rem;
    white-space: pre;
    line-height: 1.6;
}

/* ========== AGENTS ========== */
.team-section {
    margin-bottom: 2.5rem;
}

.team-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.agent-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: all 0.15s;
    box-shadow: var(--card-shadow);
}

.agent-card:hover {
    border-color: var(--primary);
}

.agent-name {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.agent-role {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.agent-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
}

/* ========== CHANGELOG ========== */
.changelog-timeline {}

.cl-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.cl-entry:last-child {
    border-bottom: none;
}

.cl-version {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cl-version code {
    background: var(--primary);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.cl-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.cl-section {
    margin-top: 0.75rem;
}

.cl-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cl-section ul {
    list-style: none;
    padding: 0;
}

.cl-section li {
    padding: 0.2rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    position: relative;
}

.cl-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ========== FOOTER ========== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.footer-right {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-right a {
    color: var(--text-secondary);
}

/* ========== LOADING ========== */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

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

    .step {
        flex-direction: column;
        gap: 0.75rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}