/* Arcoa */

:root {
    --primary: #6e7eff;
    --primary-hover: #8b96ff;
    --primary-muted: rgba(110, 126, 255, 0.12);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --bg: #0f1117;
    --bg-surface: #161922;
    --bg-elevated: #1c1f2e;
    --border: #252836;
    --border-hover: #353949;
    --text: #c9cdd8;
    --text-muted: #7c8293;
    --text-heading: #eceef3;
    --text-dim: #4e5464;
    --code-bg: #0c0e14;
    --code-inline-bg: #1e2130;
    --nav-bg: rgba(15, 17, 23, 0.92);
    --card-bg: #161922;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius: 6px;
    --radius-lg: 10px;
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-surface: #f7f8fa;
    --bg-elevated: #ffffff;
    --border: #e2e4ea;
    --border-hover: #cdd0d9;
    --text: #3c4150;
    --text-muted: #6b7080;
    --text-heading: #1a1d28;
    --text-dim: #9ca1b0;
    --code-bg: #f0f1f5;
    --code-inline-bg: #edeef3;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --card-bg: #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    background: var(--code-inline-bg);
    border-radius: 3px;
    color: var(--text);
}

pre { margin: 0; }
pre code {
    padding: 1.25rem;
    background: transparent;
    overflow-x: auto;
    display: block;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

/* Nav */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-heading);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}
.nav-logo svg { flex-shrink: 0; }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-heading); }

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--text); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle span {
    width: 18px;
    height: 1.5px;
    background: var(--text-muted);
}

/* Hero */
.hero {
    position: relative;
    padding: 7rem 0 5rem;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-align: center;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 100%);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}
.hero-glow-1 {
    width: 600px; height: 600px;
    background: var(--primary);
    top: -200px; left: 50%;
    transform: translateX(-50%);
    animation: glow-drift 8s ease-in-out infinite alternate;
}
.hero-glow-2 {
    width: 400px; height: 400px;
    background: var(--success);
    bottom: -100px; right: 10%;
    animation: glow-drift 6s ease-in-out infinite alternate-reverse;
}

@keyframes glow-drift {
    from { transform: translateX(-50%) translateY(0); }
    to   { transform: translateX(-50%) translateY(30px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--primary-muted);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1.25rem;
    color: var(--text-heading);
    letter-spacing: -0.03em;
}

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

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

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

.hero-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.flow-icon { font-size: 1.4rem; }

.flow-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 550;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}

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

.btn-secondary {
    background: var(--primary-muted);
    color: var(--primary);
    border: 1px solid transparent;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-hover); }

/* Legacy diagram — removed, replaced by hero-flow */

.diagram .node {
    padding: 0.5rem 1.25rem;
    background: var(--bg-elevated);
    color: var(--text);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.8125rem;
    min-width: 150px;
    text-align: center;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

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

.diagram .flow-label {
    margin-top: 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.section-alt {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 650;
    color: var(--text-heading);
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 2.25rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--card-bg);
}

.feature-icon {
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
    opacity: 0.7;
}

.feature-card h3 {
    margin: 0 0 0.35rem;
    color: var(--text-heading);
    font-size: 0.9rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.55;
}

/* Info Box */
.info-box {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.info-box.warning {
    border-color: rgba(251, 191, 36, 0.25);
}

.info-box h3 {
    margin: 0 0 0.5rem;
    color: var(--text-heading);
    font-size: 0.875rem;
    font-weight: 600;
}

.info-box p { margin: 0 0 0.4rem; font-size: 0.8125rem; }
.info-box p:last-child { margin-bottom: 0; }
.info-box ul { margin: 0; padding-left: 1.25rem; }
.info-box li { margin-bottom: 0.25rem; font-size: 0.8125rem; }
.info-box li:last-child { margin-bottom: 0; }

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-muted);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-content { flex: 1; }
.step-content h3 {
    margin: 0 0 0.3rem;
    color: var(--text-heading);
    font-size: 0.95rem;
    font-weight: 600;
}
.step-content > p {
    margin: 0 0 0.6rem;
    font-size: 0.875rem;
}

/* Code Block */
.code-block {
    position: relative;
    margin: 0.6rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--code-bg);
    border: 1px solid var(--border);
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.5rem;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.copy-btn:hover { color: var(--text-muted); border-color: var(--border-hover); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.code-block pre {
    margin: 0;
    padding: 1rem 1.25rem;
    color: var(--text);
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.7;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.code-block code { padding: 0; background: transparent; color: inherit; font-size: inherit; }

/* Note */
.note {
    margin-top: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-surface);
    border-left: 2px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.note code { background: var(--code-inline-bg); }

/* Auth Diagram */
.auth-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    max-width: 180px;
}

.auth-icon { font-size: 1.25rem; opacity: 0.6; }
.auth-step h3 { margin: 0; font-size: 0.8125rem; color: var(--text); font-weight: 600; }
.auth-arrow { font-size: 1.25rem; color: var(--text-dim); }
.inline-code { font-size: 0.65rem; word-break: break-all; }

/* Two Column */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.column h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 0.5rem;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.table th,
.table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table tr:last-child td { border-bottom: none; }
.table code { font-size: 0.75rem; }

/* API Section */
.api-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.api-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.api-section > h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
}

.api-endpoint {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.api-endpoint:last-child { border-bottom: none; padding-bottom: 0; }

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.method {
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-family: var(--font-mono);
}
.method.get { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.method.post { background: rgba(52, 211, 153, 0.1); color: #34d399; }
.method.patch { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.method.delete { background: rgba(248, 113, 113, 0.1); color: #f87171; }

[data-theme="light"] .method.get { background: rgba(59, 130, 246, 0.08); color: #2563eb; }
[data-theme="light"] .method.post { background: rgba(16, 185, 129, 0.08); color: #059669; }
[data-theme="light"] .method.patch { background: rgba(245, 158, 11, 0.08); color: #d97706; }
[data-theme="light"] .method.delete { background: rgba(239, 68, 68, 0.08); color: #dc2626; }

.auth-badge {
    padding: 0.1rem 0.4rem;
    background: var(--code-inline-bg);
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.endpoint-details { margin-top: 0.4rem; }
.endpoint-details summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}
.endpoint-details summary:hover { color: var(--text); }

.api-endpoint > p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Integration Topics */
.integration-topics {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.topic h3 {
    font-size: 1.1rem;
    color: var(--text-heading);
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.topic h4 {
    font-size: 0.875rem;
    color: var(--text-heading);
    margin: 1rem 0 0.4rem;
    font-weight: 600;
}
.topic h4:first-of-type { margin-top: 0.6rem; }
.topic > p { margin-bottom: 0.6rem; font-size: 0.875rem; }
.topic ul { padding-left: 1.25rem; margin: 0.4rem 0; }
.topic li { font-size: 0.8125rem; margin-bottom: 0.2rem; color: var(--text-muted); }

.text-sm {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* State Diagram */
.state-diagram {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.state {
    padding: 0.3rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-mono);
}
.state.active { border-color: var(--primary); color: var(--primary); }
.state.success { border-color: var(--success); color: var(--success); }
.state.error { border-color: var(--danger); color: var(--danger); }
.state-diagram .arrow { color: var(--text-dim); font-size: 0.85rem; }

/* Network Cards */
.network-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    margin-top: 0.6rem;
}

.network-card {
    padding: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.network-card h4 {
    margin: 0 0 0.1rem;
    color: var(--text-heading);
    font-size: 0.875rem;
}
.network-details div { margin-top: 0.5rem; }
.network-details small {
    display: block;
    color: var(--text-dim);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}
.network-details code {
    display: block;
    font-size: 0.7rem;
    word-break: break-all;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    color: var(--text-dim);
    padding: 2.5rem 0 1.25rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.footer-brand { max-width: 250px; }
.footer-brand p { margin: 0.5rem 0 0; font-size: 0.8125rem; }
.footer .nav-logo { color: var(--text-heading); }

.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-links h4 {
    color: var(--text-heading);
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.footer-links a {
    display: block;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    font-size: 0.8125rem;
}
.footer-links a:hover { color: var(--text); }

.footer-bottom {
    padding-top: 1.25rem;
    text-align: center;
}
.footer-bottom p { font-size: 0.75rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Responsive */
@media (max-width: 900px) {
    .hero-content { text-align: center; }
    .hero-actions { justify-content: center; }
    .two-column { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(12px);
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.5rem;
    }
    .nav-toggle { display: flex; }
    .hero-content h1 { font-size: 1.75rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .flow-connector { width: 20px; }
    .features-grid { grid-template-columns: 1fr; }
    .step { flex-direction: column; }
    .footer-content { flex-direction: column; gap: 1.5rem; }
    .auth-diagram { gap: 0.75rem; }
    .hero-flow { gap: 0.25rem; }
    .flow-connector { width: 16px; }
}
