/* === Theme Variables === */
:root {
    --bg: #11111b;
    --bg-surface: #181825;
    --bg-surface-alt: #1e1e2e;
    --bg-hover: #2a2a3d;
    --bg-selected: #334;
    --border: #313244;
    --border-light: #252536;
    --text: #cdd6f4;
    --text-secondary: #bac2de;
    --text-muted: #6c7086;
    --header-bg: rgba(17, 17, 27, 0.8);
    --header-text: #cdd6f4;
    --accent: #89b4fa;
    --accent-hover: #74c7ec;
    --accent-gradient: linear-gradient(135deg, #89b4fa 0%, #cba6f7 50%, #f5c2e7 100%);
    --success: #a6e3a1;
    --danger: #f38ba8;
    --warning: #f9e2af;
    --card-bg: rgba(30, 30, 46, 0.6);
    --card-border: rgba(49, 50, 68, 0.8);
    --terminal-bg: #0d0d1a;
    --terminal-border: #313244;
    --code-bg: #0d0d1a;
    --code-border: #313244;
    --code-comment: #6c7086;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 60px rgba(137, 180, 250, 0.08);
    --radius: 12px;
    --radius-lg: 16px;
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f8f9fa;
    --bg-hover: #e8f0fe;
    --bg-selected: #d0e2ff;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #999;
    --header-bg: rgba(245, 245, 247, 0.85);
    --header-text: #1a1a2e;
    --accent: #4361ee;
    --accent-hover: #3a56d4;
    --accent-gradient: linear-gradient(135deg, #4361ee 0%, #7209b7 50%, #f72585 100%);
    --success: #2d6a4f;
    --danger: #c1121f;
    --warning: #b45309;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(224, 224, 224, 0.8);
    --terminal-bg: #1a1a2e;
    --terminal-border: #333;
    --code-bg: #f4f4f5;
    --code-border: #d4d4d8;
    --code-comment: #71717a;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 60px rgba(67, 97, 238, 0.06);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* === Header === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--header-text);
    letter-spacing: -0.02em;
}
.logo:hover { color: var(--header-text); }
.logo-icon { font-size: 22px; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.header-nav a {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.header-nav a:hover { background: var(--bg-hover); color: var(--text); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); border-color: var(--text-muted); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn-primary {
    background: var(--accent);
    color: #11111b;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #11111b;
    box-shadow: 0 4px 20px rgba(137, 180, 250, 0.3);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

/* === Hero === */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(137,180,250,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* === Terminal === */
.hero-terminal {
    margin: 56px auto 0;
    max-width: 680px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--terminal-bg);
    border: 1px solid var(--terminal-border);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    text-align: left;
}

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

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.red { background: #f38ba8; }
.terminal-dot.yellow { background: #f9e2af; }
.terminal-dot.green { background: #a6e3a1; }

.terminal-title {
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.terminal-body {
    padding: 20px 24px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 14px;
    line-height: 1.8;
    overflow-x: auto;
}

.terminal-line { display: flex; gap: 8px; min-width: 0; }
.terminal-line.spacer { height: 12px; }
.t-prompt { color: var(--success); flex-shrink: 0; }
.t-cmd { color: var(--text); }
.t-output { color: var(--text-muted); }
.t-success { color: var(--success); }
.t-comment { color: var(--text-muted); opacity: 0.6; }

/* === Sections === */
section:not(.hero):not(.cta) {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: center;
}

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

/* === Features Grid === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(8px);
}

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

.feature-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

/* === Install === */
.install-card {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.install-step {
    display: flex;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

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

.step-content { flex: 1; min-width: 0; }

.step-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.code-block {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
}

.code-block code, .code-block pre {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    color: var(--text);
    white-space: pre;
    flex: 1;
}

.code-block pre { line-height: 1.7; }
.code-block .t-comment { color: var(--code-comment); opacity: 0.8; }
.code-block .t-output { color: var(--code-comment); }

.copy-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.copy-btn:hover { background: var(--bg-hover); color: var(--text); }
.copy-btn.copied { background: var(--success); color: #111; border-color: var(--success); }

/* === Usage === */
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.usage-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
}

.usage-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.usage-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.web-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.web-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.wf-icon { font-size: 16px; }

/* === Architecture === */
.tree-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px 28px;
    overflow-x: auto;
}

.file-tree {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
    white-space: pre;
}

.file-tree .t-comment { color: var(--text-muted); opacity: 0.7; }

/* === Dependencies === */
.deps-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.dep-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
}

.dep-name {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.dep-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* === CTA === */
.cta {
    text-align: center;
    padding: 80px 0 100px;
    border-top: 1px solid var(--border);
}

.cta h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.cta p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* === Footer === */
.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

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

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

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #11111b;
    background: var(--success);
    z-index: 9999;
    animation: fadeUp 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .hero { padding: 100px 0 60px; }
    .hero-title { font-size: 36px; }
    .hero-desc { font-size: 16px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 320px; justify-content: center; }

    .hero-terminal {
        max-width: 100%;
        margin: 40px 0 0;
    }
    .terminal-body {
        font-size: 11px;
        padding: 14px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .section-title { font-size: 28px; }
    .section-desc { margin-bottom: 32px; }

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

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

    .header-nav { display: none; }

    .install-card { max-width: 100%; }
    .install-step { padding: 16px; }

    .code-block {
        padding: 10px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .code-block code, .code-block pre { font-size: 12px; white-space: pre-wrap; word-break: break-all; }
    .code-block pre { white-space: pre-wrap; }

    .tree-card {
        max-width: 100%;
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .file-tree {
        font-size: 11px;
        white-space: pre-wrap;
        word-break: break-all;
    }

    .deps-grid { gap: 8px; }
    .dep-card { padding: 12px 16px; }

    .cta h2 { font-size: 24px; }

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

    section:not(.hero):not(.cta) { padding: 48px 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero { padding: 88px 0 48px; }
    .hero-title { font-size: 26px; }
    .hero-desc { font-size: 15px; }
    .hero-terminal { margin: 32px 0 0; }
    .terminal-body { font-size: 10px; padding: 10px 8px; }
    .section-title { font-size: 24px; }
    .feature-card { padding: 20px; }
    .usage-card { padding: 20px; }
    .step-num { width: 30px; height: 30px; font-size: 14px; }
}
