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

:root {
    --bg: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --accent: #0284c7; /* Sea Blue */
    --accent-hover: #0369a1;
    --accent-glow: rgba(2, 132, 199, 0.08);
    --success: #10b981;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
}

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

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

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.3rem;
    line-height: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

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

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* === Hero === */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    background: radial-gradient(circle at 50% -20%, rgba(2, 132, 199, 0.1) 0%, transparent 70%);
}

.hero-image {
    max-width: 480px;
    height: auto;
    margin: 0 auto 2.5rem;
    display: block;
    filter: drop-shadow(0 20px 30px rgba(2, 132, 199, 0.15));
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.hero .accent {
    color: var(--accent);
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--accent);
}

.hero-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.hero-meta .sep {
    margin: 0 0.6rem;
    opacity: 0.5;
}

/* === Pipeline === */
.pipeline {
    padding: 30px 0 50px;
    border-bottom: 1px solid var(--border);
}

.pipeline-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.pipeline-step {
    padding: 0.4rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

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

/* === Features === */
.features {
    padding: 80px 0;
}

.features h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

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

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

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* === Quick Start === */
.quickstart {
    padding: 80px 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.quickstart h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.quickstart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.quickstart-step {
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.quickstart-step h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quickstart-step p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.quickstart-step p code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-elevated);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
}

.code-example h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* === Code Blocks === */
.code-block {
    position: relative;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.code-block pre {
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
}

.code-block code {
    font-family: inherit;
    color: #e2e8f0;
    background: transparent !important;
    padding: 0 !important;
}

.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.copy-btn.copied {
    color: var(--success);
    border-color: var(--success);
}

.kw { color: #93c5fd; font-weight: 600; }
.cmt { color: #64748b; font-style: italic; }

/* === Architecture === */
.architecture {
    padding: 80px 0;
}

.architecture h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.arch-diagram {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.arch-layer {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.arch-input {
    background: var(--accent-glow);
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--accent);
}

.arch-output {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--success);
}

.arch-block {
    padding: 1.25rem;
}

.arch-block-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.arch-block-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.arch-block-items span {
    padding: 0.35rem 0.7rem;
    background: var(--bg-elevated);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.arch-arrow {
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1;
}

/* === Docs === */
.docs {
    padding: 80px 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.docs h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

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

.doc-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.doc-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.doc-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.doc-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.doc-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* === Training Modes === */
.training-modes {
    padding: 80px 0;
}

.training-modes h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3rem;
}

.modes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.modes-table thead {
    border-bottom: 1px solid var(--border);
}

.modes-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modes-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
}

.modes-table td:first-child {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85em;
    white-space: nowrap;
}

.modes-table tr:hover td {
    background: var(--bg-card);
}

/* === Footer === */
.footer {
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
    text-align: center;
}

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

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-dim);
}


/* === Responsive === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

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

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

    .pipeline-flow {
        gap: 0.4rem;
    }

    .pipeline-step {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

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

    .modes-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* === Documentation Viewer === */
.docs-page .navbar {
    position: sticky;
}

.docs-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
}

.docs-sidebar {
    width: 280px;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--bg-elevated);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section ul li {
    margin-bottom: 0.5rem;
}

.sidebar-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: block;
    padding: 0.25rem 0;
}

.sidebar-section ul li a:hover,
.sidebar-section ul li a.active {
    color: var(--accent);
}

.docs-content {
    flex: 1;
    padding: 3rem 4rem;
    max-width: 900px;
}

/* === Markdown Content === */
.markdown-body {
    color: var(--text);
    line-height: 1.7;
}

.markdown-body h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.markdown-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.markdown-body h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.markdown-body p {
    margin-bottom: 1.25rem;
}

.markdown-body ul, 
.markdown-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body :not(pre) > code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-elevated);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
}

.markdown-body pre {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    color: #e2e8f0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.88rem;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--border);
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent);
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.markdown-body th, 
.markdown-body td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.markdown-body th {
    background: var(--bg-card);
    color: var(--text);
    font-weight: 600;
}

.loader {
    display: flex;
    justify-content: center;
    padding: 4rem;
    color: var(--text-dim);
    font-style: italic;
}

.error-msg {
    text-align: center;
    padding: 4rem 2rem;
}

.error-msg h3 {
    color: #ef4444;
    margin-bottom: 1rem;
}

/* === Responsive Docs === */
@media (max-width: 1024px) {
    .docs-layout {
        flex-direction: column;
    }
    
    .docs-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.5rem;
    }
    
    .docs-content {
        padding: 2rem 1.5rem;
    }
}
