/* ============================================================
   ARC Documentation Site
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --bg-code: #f6f6f8;
    --bg-card: #ffffff;
    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --text-dim: #d4d4d8;
    --link: #18181b;
    --link-hover: #52525b;
    --border: #e4e4e7;
    --border-light: #f4f4f5;
    --grid-color: rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
    --transition: 0.15s ease;
    --max-width: 1280px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; font-size: 15px; }
a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border); transition: var(--transition); }
a:hover { color: var(--text); text-decoration-color: var(--text); }
code { font-family: var(--mono); font-size: 0.875em; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); height: 52px; }
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; height: 100%; gap: 28px; }
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo-text { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo-version { font-size: 0.62rem; color: var(--text-muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; font-weight: 500; }
.nav-links { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav-link { color: var(--text-muted); font-size: 0.82rem; font-weight: 450; padding: 5px 10px; border-radius: 5px; text-decoration: none; transition: var(--transition); }
.nav-link:hover { color: var(--text); background: var(--bg-alt); }
.nav-link.active { color: var(--text); font-weight: 550; }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 4px; padding: 6px; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--text); border-radius: 1px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-weight: 500; border-radius: 6px; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; font-size: 0.82rem; }
.btn-sm { padding: 5px 13px; }
.btn-lg { padding: 9px 20px; font-size: 0.88rem; }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #333; color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-secondary); }

/* HERO */
.hero { padding: 128px 0 72px; text-align: center; position: relative; }
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: 32px 32px;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}
.hero-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 20px; font-weight: 450; }
.badge-dot { width: 5px; height: 5px; background: #22c55e; border-radius: 50%; animation: pulse 2.5s ease infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:0.3 } }
.hero-title { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; line-height: 1.2; letter-spacing: -1.2px; margin-bottom: 14px; }
.hero-sub { font-size: 1rem; color: var(--text-secondary); max-width: 480px; margin: 0 auto 28px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 48px; }
.install-cmd { display: flex; align-items: center; gap: 10px; background: var(--bg-code); padding: 9px 14px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); transition: var(--transition); }
.install-cmd:hover { border-color: var(--text-muted); }
.install-cmd code { color: var(--text); font-size: 0.85rem; font-weight: 500; }
.copy-icon { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font); font-weight: 500; }
.hero-code { max-width: 520px; margin: 0 auto; }

/* CODE */
.code-window { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-align: left; }
.code-header { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

@keyframes macWave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hero-code.animating .dot {
    animation: macWave 0.6s ease-in-out;
}
.hero-code.animating .dot.red { animation-delay: 0s; }
.hero-code.animating .dot.yellow { animation-delay: 0.1s; }
.hero-code.animating .dot.green { animation-delay: 0.2s; }

.type-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: var(--text-muted);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}
@keyframes blink {
    50% { opacity: 0; }
}
.code-filename { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-family: var(--mono); }
.code-block { padding: 18px; font-family: var(--mono); font-size: 0.8rem; line-height: 1.75; overflow-x: auto; color: #374151; }
.code-block .kw { color: #7c3aed; }
.code-block .mod { color: #1d4ed8; }
.code-block .cls { color: #b45309; }
.code-block .fn { color: #1d4ed8; }
.code-block .str { color: #0f766e; }
.code-block .num { color: #1d4ed8; }
.code-block .cmt { color: #9ca3af; }

/* STATS */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 32px 0; background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); letter-spacing: -0.8px; }
.stat-unit { font-size: 0.9rem; font-weight: 600; }
.stat-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; font-weight: 450; letter-spacing: 0.2px; }

/* SECTIONS */
.section { padding: 72px 0; }
.section-dark { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.section-title { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -0.6px; margin-bottom: 10px; }
.section-sub { font-size: 0.92rem; color: var(--text-secondary); max-width: 520px; line-height: 1.65; }

/* CARDS */
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 36px; }
.problem-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; transition: var(--transition); }
.problem-card:hover { border-color: var(--text-muted); }
.problem-icon { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); font-family: var(--mono); margin-bottom: 12px; }
.problem-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 5px; }
.problem-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

/* PIPELINE */
.pipeline { display: flex; align-items: flex-start; gap: 10px; margin-top: 36px; justify-content: center; flex-wrap: wrap; }
.pipeline-step { flex: 1; min-width: 200px; max-width: 300px; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 18px; text-align: left; transition: var(--transition); }
.pipeline-step:hover { border-color: var(--text-muted); }
.step-num { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; font-family: var(--mono); margin-bottom: 10px; }
.pipeline-step h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.pipeline-step p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }
.pipeline-arrow { color: var(--text-dim); align-self: center; margin-top: 24px; font-size: 1rem; }

/* FEATURES */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 36px; }
.feature-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; transition: var(--transition); }
.feature-card:hover { border-color: var(--text-muted); }
.feature-icon { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); font-family: var(--mono); margin-bottom: 10px; }
.feature-card h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 5px; }
.feature-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }
.feature-card code { background: var(--bg-code); padding: 1px 5px; border-radius: 3px; font-size: 0.82em; border: 1px solid var(--border-light); }

/* ARCHITECTURE */
.arch-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin-top: 36px; align-items: start; }
.arch-info { display: flex; flex-direction: column; gap: 10px; }
.arch-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.arch-item h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.arch-item p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.arch-item code { background: var(--bg-code); padding: 1px 4px; border-radius: 3px; font-size: 0.82em; border: 1px solid var(--border-light); }

/* COMPAT */
.compat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 28px; }
.compat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; font-weight: 500; font-size: 0.85rem; transition: var(--transition); }
.compat-card:hover { border-color: var(--text-muted); }

/* CTA */
.section-cta { background: var(--bg-alt); border-top: 1px solid var(--border); text-align: center; }

/* FOOTER */
.footer { border-top: 1px solid var(--border); padding: 44px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer-brand p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }
.footer-copy { margin-top: 12px; font-size: 0.72rem; color: var(--text-muted); }
.footer-links h4 { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.footer-links a { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 7px; text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* DOCS LAYOUT */
.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding-top: 72px; min-height: 100vh; }
.sidebar { padding-right: 16px; border-right: 1px solid var(--border-light); }
.sidebar-group { margin-bottom: 22px; }
.sidebar-group h4 { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.sidebar-link { display: block; padding: 3px 10px; font-size: 0.82rem; color: var(--text-muted); border-left: 1.5px solid transparent; margin-bottom: 1px; transition: var(--transition); text-decoration: none; }
.sidebar-link:hover { color: var(--text-secondary); }
.sidebar-link.active { color: var(--text); border-left-color: var(--text); font-weight: 550; }

/* DOC CONTENT */
.doc-content { padding-bottom: 72px; max-width: 100%; }
.doc-content h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc-content h2 { font-size: 1.25rem; font-weight: 650; margin-top: 44px; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--border-light); letter-spacing: -0.2px; }
.doc-content h3 { font-size: 1rem; font-weight: 600; margin-top: 28px; margin-bottom: 8px; }
.doc-content p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; font-size: 0.9rem; }
.doc-content ul, .doc-content ol { color: var(--text-secondary); padding-left: 18px; margin-bottom: 12px; font-size: 0.9rem; }
.doc-content li { margin-bottom: 4px; line-height: 1.6; }
.doc-content strong { color: var(--text); font-weight: 600; }
.doc-content .code-window { margin: 14px 0 18px; }
.doc-content p code, .doc-content li code { background: var(--bg-code); padding: 1px 5px; border-radius: 3px; font-size: 0.84em; border: 1px solid var(--border-light); }

/* TABLES */
.doc-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.82rem; }
.doc-table th { text-align: left; padding: 8px 12px; border-bottom: 1.5px solid var(--border); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }
.doc-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.doc-table tr:hover td { background: var(--bg-alt); }
.doc-table code { background: var(--bg-code); padding: 1px 4px; border-radius: 3px; font-size: 0.88em; border: 1px solid var(--border-light); }

/* CALLOUTS */
.callout { border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; border: 1px solid var(--border); background: var(--bg-alt); }
.callout-info { border-left: 2px solid #3b82f6; }
.callout-warn { border-left: 2px solid #f59e0b; }
.callout-tip { border-left: 2px solid #10b981; }
.callout-title { font-weight: 600; font-size: 0.82rem; margin-bottom: 3px; }
.callout p { font-size: 0.82rem; color: var(--text-secondary); margin: 0; line-height: 1.55; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; overflow: hidden; }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; font-weight: 550; font-size: 0.9rem; transition: var(--transition); }
.faq-q:hover { background: var(--bg-alt); }
.faq-arrow { transition: transform 0.2s ease; font-size: 0.7rem; color: var(--text-muted); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.2s ease; }
.faq-item.open .faq-a { padding: 0 18px 14px; max-height: 400px; }
.faq-a p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.65; }

/* BENCHMARK BARS */
.bench-bar-group { margin: 16px 0; }
.bench-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bench-bar-label { width: 130px; font-size: 0.8rem; color: var(--text-secondary); text-align: right; flex-shrink: 0; }
.bench-bar-track { flex: 1; height: 26px; background: var(--bg-alt); border-radius: 5px; overflow: hidden; border: 1px solid var(--border-light); }
.bench-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 10px; font-size: 0.72rem; font-weight: 600; }
.bench-bar-fill.arc { background: var(--text); color: #fff; }
.bench-bar-fill.alt { background: #e5e5e5; color: var(--text-secondary); }

/* ANIMATIONS */
.fade-section { opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease, transform 0.4s ease; }
.fade-section.visible { opacity: 1; transform: translateY(0); }

/* THEME TOGGLE */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 5px 8px; display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text-muted); }
.theme-toggle:hover { border-color: var(--text-muted); color: var(--text); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* DARK MODE */
[data-theme="dark"] {
    --bg: #0a0a0b;
    --bg-alt: #111113;
    --bg-code: #161618;
    --bg-card: #111113;
    --text: #ececef;
    --text-secondary: #a1a1aa;
    --text-muted: #63636e;
    --text-dim: #3f3f46;
    --link: #ececef;
    --link-hover: #a1a1aa;
    --border: #27272a;
    --border-light: #1e1e21;
    --grid-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .nav { background: rgba(10,10,11,0.92); }
[data-theme="dark"] .code-block { color: #d1d5db; }
[data-theme="dark"] .code-block .kw { color: #c084fc; }
[data-theme="dark"] .code-block .mod { color: #60a5fa; }
[data-theme="dark"] .code-block .cls { color: #fbbf24; }
[data-theme="dark"] .code-block .fn { color: #60a5fa; }
[data-theme="dark"] .code-block .str { color: #34d399; }
[data-theme="dark"] .code-block .num { color: #60a5fa; }
[data-theme="dark"] .code-block .cmt { color: #4b5563; }
[data-theme="dark"] .btn-primary { background: #ececef; color: #0a0a0b; }
[data-theme="dark"] .btn-primary:hover { background: #d4d4d8; color: #0a0a0b; }
[data-theme="dark"] .bench-bar-fill.arc { background: #ececef; color: #0a0a0b; }
[data-theme="dark"] .bench-bar-fill.alt { background: #27272a; color: #a1a1aa; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* RESPONSIVE */
/* Very Large Screens */
@media (min-width: 1441px) {
    .container { padding: 0 40px; }
}

/* Large Screens */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

/* Tablets / Laptops */
@media (max-width: 1024px) {
    .arch-grid { grid-template-columns: 1fr; gap: 20px; }
    .docs-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 48px; }
    .sidebar { display: none; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .problem-grid, .features-grid { grid-template-columns: repeat(2, 1fr); }
    .doc-content { padding-bottom: 48px; }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .hero { padding: 80px 0 36px; }
    .hero-title { font-size: 2.2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .nav-links { display: none; position: absolute; top: 52px; left: 0; right: 0; height: calc(100vh - 52px); background: var(--bg); flex-direction: column; justify-content: flex-start; align-items: center; padding-top: 40px; gap: 24px; z-index: 200; overflow-y: auto; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }
    .pipeline-arrow { display: none; }
    .pipeline { flex-direction: column; align-items: center; gap: 16px; }
    .pipeline-step { max-width: 100%; width: 100%; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .compat-grid { grid-template-columns: repeat(2, 1fr); }
    .problem-grid, .features-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; width: 100%; max-width: 320px; margin: 0 auto 36px; }
    .hero-actions .btn, .hero-actions .install-cmd { width: 100%; justify-content: center; }
    .section { padding: 40px 0; }
    .container { padding: 0 16px; }
    .doc-table { display: block; overflow-x: auto; white-space: nowrap; }
    .bench-bar { flex-direction: column; align-items: stretch; gap: 4px; }
    .bench-bar-label { text-align: left; width: auto; }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.8rem; }
    .nav-inner { gap: 12px; }
    .compat-grid { grid-template-columns: 1fr; }
    .hero-code { margin: 0 -16px; border-radius: 0; border-left: none; border-right: none; }
    .code-window { border-radius: 0; border-left: none; border-right: none; }
}
