/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a28;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-start: #7c3aed;
    --accent-end: #3b82f6;
    --border: #1e1e2e;
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ── Nav ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 14px;
    color: var(--text-muted);
}

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

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

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

.btn-outline:hover {
    border-color: var(--accent-start);
    background: rgba(124, 58, 237, 0.08);
}

/* ── Hero ── */
.hero {
    padding: 160px 0 80px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-start);
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.08);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(36px, 5vw, 60px);
    background: linear-gradient(135deg, #e2e8f0 0%, #a78bfa 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-visual {
    max-width: 700px;
    margin: 0 auto;
}

.hero-visual-team {
    max-width: 900px;
}

#graph-container {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

#graph-container canvas {
    display: block;
    border-radius: var(--radius);
    touch-action: none;
}

.graph-interactive-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 100px;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.graph-interactive-badge svg {
    opacity: 0.6;
}

.graph-hints {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    border-radius: 100px;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.6s;
    z-index: 1;
}

.graph-hints.hidden {
    opacity: 0;
}

.graph-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.graph-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.graph-label-topic {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.graph-hint-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
}

/* ── Memory Detail Panel ── */
.memory-panel-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.memory-panel {
    position: absolute;
    top: 16px;
    width: min(400px, 35%);
    max-height: 70%;
    background: rgb(20, 25, 36);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.memory-panel.panel-right {
    right: 16px;
    left: auto;
    transform: translateX(110%);
}

.memory-panel.panel-left {
    left: 16px;
    right: auto;
    transform: translateX(-110%);
}

.memory-panel.visible {
    transform: translateX(0);
    opacity: 1;
}

.memory-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.memory-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.memory-panel-project {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.memory-panel-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
}

.memory-panel-topic {
    font-size: 12px;
    color: var(--text-muted);
}

.memory-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}

.memory-panel-close:hover {
    color: var(--text);
}

.memory-panel-content {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text);
    text-align: left;
}

.memory-panel-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.memory-panel-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Mobile memory panel ── */
@media (max-width: 600px) {
    .memory-panel {
        top: 8px;
        width: min(220px, 52%);
        max-height: 80%;
        border-radius: 12px;
    }
    .memory-panel.panel-right {
        right: 8px;
    }
    .memory-panel.panel-left {
        left: 8px;
    }
    .memory-panel-header {
        padding: 10px 10px 8px;
        gap: 5px;
    }
    .memory-panel-dot {
        width: 6px;
        height: 6px;
    }
    .memory-panel-project {
        font-size: 10px;
    }
    .memory-panel-topic {
        font-size: 10px;
    }
    .memory-panel-close {
        font-size: 14px;
        padding: 2px;
    }
    .memory-panel-content {
        font-size: 10px;
        line-height: 1.5;
        padding: 8px 10px;
    }
    .memory-panel-footer {
        padding: 8px 10px;
        font-size: 9px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .memory-panel-sep {
        width: 2px;
        height: 2px;
    }
}

/* ── Sections ── */
section {
    padding: 100px 0;
}

section h2 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 12px;
}

.section-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 56px;
}

/* ── Grids ── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    min-width: 0;
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    background: var(--bg-card-hover);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(124, 58, 237, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.card-code {
    display: block;
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #818cf8;
    font-family: 'SF Mono', 'Fira Code', monospace;
    overflow-x: auto;
    white-space: nowrap;
}

/* ── Features ── */
.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.2s;
    overflow: hidden;
    min-width: 0;
}

.feature:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.feature h3 {
    font-size: 16px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Pricing ── */
.pricing {
    background: linear-gradient(180deg, var(--bg) 0%, #0d0d14 100%);
}

.pricing-grid {
    align-items: start;
}

.pricing-card {
    text-align: center;
    padding: 36px 28px;
    position: relative;
    overflow: visible;
}

.pricing-featured {
    border-color: var(--accent-start);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.06) 0%, var(--bg-card) 100%);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
    letter-spacing: 0.03em;
}

.pricing-tier {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 48px;
    font-weight: 700;
}

.pricing-period {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
}

.pricing-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(30, 30, 46, 0.6);
}

.pricing-features li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-start);
    margin-right: 10px;
    vertical-align: middle;
}

.pricing-card .btn-primary {
    width: 100%;
}

/* ── Install ── */
.install {
    text-align: center;
}

.install-methods {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}

.install-method {
    flex: 1;
    max-width: 480px;
    min-width: 0;
}

.install-method h3 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.code-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    min-width: 0;
    overflow: hidden;
}

.code-block code {
    flex: 1;
    min-width: 0;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #a78bfa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: var(--text);
}

.install-app {
    margin-bottom: 24px;
}

.install-or {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.install-note {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── FAQ ── */
.faq-list {
    max-width: 680px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    padding: 20px 0;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: color 0.2s;
}

.faq-item summary:hover {
    color: #a78bfa;
}

.faq-item summary::after {
    content: '+';
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    padding: 0 0 20px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text);
}

/* ── Individual Graph Section ── */
.individual-graph {
    background: linear-gradient(180deg, var(--bg) 0%, #0d0d14 50%, var(--bg) 100%);
}

.individual-graph-visual {
    max-width: 700px;
    margin: 0 auto;
}

/* ── Team Graph (hero context) ── */
#team-graph-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
}

#team-graph-container canvas {
    display: block;
    border-radius: var(--radius);
}

.team-sync-legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
}

.team-sync-engineer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.team-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-graph-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.team-graph-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.team-graph-label-hive {
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
}

.team-graph-label-topic {
    font-size: 8px;
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-sub {
        font-size: 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    section {
        padding: 60px 0;
    }

    section h2 {
        font-size: 28px;
    }

    .install-methods {
        flex-direction: column;
        align-items: center;
    }

    .install-method {
        width: 100%;
    }

    .nav-links a:not(.btn) {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
    }

    #team-graph-container {
        aspect-ratio: 9 / 14;
    }

    .team-sync-legend {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}
