/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafafa;
    --bg-alt: #ffffff;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8b8da3;
    --border: #e4e5ea;
    --accent: #5865F2;
    --accent-hover: #4752C4;
    --accent-glow: rgba(88, 101, 242, 0.15);
    --surface: #f0f1f5;
    --surface-hover: #e8e9ef;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    background: var(--surface);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--text-muted);
    box-shadow: none;
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 14px;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    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: 20px;
}

.logo-svg {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: 160px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow), transparent),
        radial-gradient(ellipse 40% 40% at 80% 20%, rgba(88, 101, 242, 0.08), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
}

.hero h1 {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.accent {
    color: var(--accent);
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 64px;
}

/* ===== App Preview ===== */
.hero-preview {
    max-width: 900px;
    margin: 0 auto;
}

.preview-window {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 20px 40px rgba(0,0,0,0.06);
}

.preview-image {
    display: block;
    width: 100%;
    height: auto;
}

.preview-titlebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.preview-dots {
    display: flex;
    gap: 6px;
}

.preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #febc2e; }
.preview-dots span:nth-child(3) { background: #28c840; }

.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.preview-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 340px;
}

.preview-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.preview-server-header {
    padding: 12px 14px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.preview-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
}

.preview-tabs span {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: default;
}

.preview-tabs span.active {
    background: var(--surface-hover);
    color: var(--text);
}

.preview-channels {
    padding: 8px;
    flex: 1;
}

.preview-channel {
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: 4px;
    margin-bottom: 2px;
}

.preview-channel.active {
    background: var(--surface-hover);
    color: var(--text);
    font-weight: 500;
}

.preview-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface-hover);
}

.preview-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-username {
    font-size: 12px;
    font-weight: 600;
}

.preview-status {
    font-size: 10px;
    color: #23A559;
}

.preview-chat {
    display: flex;
    flex-direction: column;
}

.preview-chat-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.preview-messages {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-msg {
    display: flex;
    gap: 10px;
}

.preview-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-msg-meta {
    font-size: 13px;
    margin-bottom: 2px;
}

.preview-msg-meta strong {
    font-weight: 600;
}

.preview-msg-meta span {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
}

.preview-msg-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.preview-input {
    margin: 0 16px 14px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Features ===== */
.features {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 17px;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 24px var(--accent-glow);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Server Section ===== */
.server-section {
    padding: 100px 0;
    background: var(--surface);
}

.server-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
}

.server-info h2 {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.server-info > p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.server-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.step strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.step p {
    font-size: 14px;
    color: var(--text-secondary);
}

.server-config-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-window, .config-api {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.config-titlebar {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.config-code {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text);
    overflow-x: auto;
}

.toml-key { color: var(--accent); }
.toml-eq  { color: var(--text-muted); }
.toml-val { color: #23A559; }
.toml-num { color: #e67e22; }

/* ===== Roadmap ===== */
.roadmap {
    padding: 100px 0;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.roadmap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.roadmap-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.roadmap-card.done .roadmap-status {
    background: rgba(35, 165, 89, 0.12);
    color: #23A559;
}

.roadmap-card.planned .roadmap-status {
    background: var(--accent-glow);
    color: var(--accent);
}

.roadmap-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.roadmap-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Download ===== */
.download {
    padding: 100px 0;
    background: var(--surface);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.download-card.highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 8px 24px var(--accent-glow);
}

.download-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.download-icon svg {
    width: 28px;
    height: 28px;
}

.download-card h3 {
    font-size: 18px;
    font-weight: 700;
}

.download-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.download-tech {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface);
    padding: 3px 10px;
    border-radius: 4px;
}

.download-card .btn {
    margin-top: 8px;
    width: 100%;
}

.download-dropdown {
    position: relative;
    margin-top: 8px;
    width: 100%;
}

.download-toggle {
    list-style: none;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
}

.download-toggle::-webkit-details-marker {
    display: none;
}

.download-toggle::marker {
    content: "";
}

.download-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.download-caret {
    font-size: 10px;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.download-dropdown[open] .download-caret {
    transform: rotate(180deg);
}

.download-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(88, 101, 242, 0.06);
    overflow: hidden;
    z-index: 10;
}

.download-option {
    display: block;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.download-option + .download-option {
    border-top: 1px solid var(--border);
}

.download-option:hover {
    background: var(--surface);
    color: var(--text);
}

/* ===== Footer ===== */
.footer {
    padding: 64px 0 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand p {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 64px;
}

.footer-links h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    .preview-body {
        grid-template-columns: 1fr;
    }

    .preview-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .preview-channels {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 8px;
    }

    .preview-profile {
        display: none;
    }

    .server-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .features-grid,
    .roadmap-grid,
    .download-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: 32px;
    }

    .footer-links {
        gap: 40px;
    }
}
