/* ═══════════════════════════════════════════
   codetree — Clean monochrome design
   ═══════════════════════════════════════════ */

:root {
    --bg: #ffffff;
    --bg-alt: #f7f7f8;
    --text: #111111;
    --text-2: #555555;
    --text-3: #999999;
    --border: #e5e5e5;
    --border-2: #d4d4d4;
    --accent: #111111;
    --green: #16a34a;
    --red: #dc2626;
    --sans: 'Inter', -apple-system, system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
    --max-w: 1060px;
    --radius: 10px;
}

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

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


/* ─── Nav ─── */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s;
}

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

.nav-gh {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text) !important;
    font-weight: 600 !important;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.15s;
}

.nav-gh:hover {
    background: var(--bg-alt);
    border-color: var(--border-2);
}


/* ─── Layout ─── */

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 16px;
    text-align: center;
}

.section-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.section-sub {
    font-size: 1.05rem;
    color: var(--text-2);
    max-width: 560px;
    line-height: 1.7;
    margin: 0 auto 48px;
    text-align: center;
    font-weight: 400;
}


/* ─── Hero ─── */

.hero {
    padding: 140px 0 80px;
    text-align: center;
}

.hero-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
}

.hero-title {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.08;
    margin-bottom: 20px;
}

.hero-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-2);
    max-width: 540px;
    line-height: 1.7;
    margin: 0 auto 36px;
}

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

.install-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.install-cmd {
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--text);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 2px;
    display: flex;
    transition: color 0.15s;
}

.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--green); }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }

.btn-lg {
    padding: 13px 28px;
    font-size: 0.9375rem;
}

.hero-pitch {
    font-size: 0.9rem;
    color: var(--text-3);
    max-width: 620px;
    line-height: 1.6;
    margin: 0 auto;
}

.hero-pitch code {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--text-2);
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}


/* ─── Demo Terminal ─── */

.panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.panel-dot.red { background: #ff5f56; }
.panel-dot.yellow { background: #ffbd2e; }
.panel-dot.green { background: #27c93f; }

.demo-terminal {
    max-width: 680px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    border: 1px solid #2a2a2a;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.demo-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.demo-bar-title {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: #555;
    margin-left: auto;
    margin-right: auto;
    transform: translateX(-12px);
}

.demo-body {
    padding: 20px;
}

.demo-block + .demo-block {
    margin-top: 0;
}

.demo-cmd {
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: #e0e0e0;
    margin-bottom: 12px;
}

.demo-prompt {
    color: #4ade80;
    margin-right: 8px;
    user-select: none;
}

.demo-output {
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.65;
    color: #888;
    white-space: pre;
    overflow-x: auto;
    position: relative;
}

.demo-output code {
    display: block;
}

.demo-output-before {
    max-height: 160px;
    overflow: hidden;
}

.demo-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #111);
    pointer-events: none;
}

.demo-output-after code {
    color: #c8f7c5;
}

.demo-token-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.demo-token-bar {
    height: 4px;
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-before {
    width: 100%;
    background: #dc2626;
    opacity: 0.5;
}

.bar-after {
    width: 4%;
    background: #4ade80;
}

.demo-token-label {
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}

.label-before { color: #f87171; }
.label-after { color: #4ade80; }

.demo-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.demo-divider::before,
.demo-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2a2a2a;
}

.demo-divider span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4ade80;
}

.demo-footer {
    padding: 14px 20px;
    background: #161616;
    border-top: 1px solid #2a2a2a;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.demo-result {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.25rem;
    color: #fff;
}

.demo-result-sub {
    font-size: 0.8125rem;
    color: #555;
}


/* ─── Problem ─── */

.problem-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
}

.problem-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 24px;
}

.problem-item:first-child {
    border-top: 1px solid var(--border);
}

.problem-what {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
}

.problem-why {
    font-size: 0.8125rem;
    color: var(--red);
    font-weight: 500;
    white-space: nowrap;
}


/* ─── Solution Flow ─── */

.flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 380px;
    margin: 0 auto 56px;
}

.flow-step {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.flow-step small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 400;
    font-family: var(--mono);
    margin-top: 2px;
}

.flow-active {
    border-color: var(--accent);
    background: var(--text);
    color: #fff;
}

.flow-active small { color: #bbb; }

.flow-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: var(--green);
    font-weight: 600;
}

.flow-arrow {
    font-size: 1.1rem;
    color: var(--text-3);
    line-height: 1;
    padding: 6px 0;
}

.features {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 16px;
}

.feature {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    text-align: center;
}

.feature strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.feature span {
    font-size: 0.8125rem;
    color: var(--text-3);
}


/* ─── Tools ─── */

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tool-group h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--text);
}

.tool-list {
    display: flex;
    flex-direction: column;
}

.tool {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool:last-child { border-bottom: none; }

.tool code {
    font-family: var(--mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
}

.tool span {
    font-size: 0.8125rem;
    color: var(--text-3);
}


/* ─── Ecosystem ─── */

.eco-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.eco-block .section-title {
    font-size: 1.75rem;
    text-align: left;
    font-weight: 500;
}

.eco-block .section-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
}

.eco-block .section-sub {
    margin: 0 0 24px;
    text-align: left;
}

.lang-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lang-tags span {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    transition: all 0.15s;
}

.lang-tags span:hover {
    border-color: var(--text);
    background: var(--text);
    color: #fff;
}


/* ─── Tabs ─── */

.tab-bar {
    display: flex;
    gap: 2px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-3);
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover { color: var(--text-2); }

.tab-btn.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.tab-pane pre,
.client-tabs pre {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 14px;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: #ccc;
    line-height: 1.65;
    overflow-x: auto;
    margin: 0;
}


/* ─── Stats ─── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-num {
    display: block;
    font-family: var(--serif);
    font-style: italic;
    font-size: 3.25rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-3);
    font-weight: 500;
}


/* ─── Alt Table ─── */

.alt-table {
    margin: 40px auto 0;
    max-width: 800px;
}

.alt-row {
    display: grid;
    grid-template-columns: 170px 1fr 1fr;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    align-items: baseline;
}

.alt-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    border-bottom: 2px solid var(--text);
    padding-bottom: 10px;
}

.alt-name { font-weight: 600; }
.alt-bad { color: var(--text-3); }
.alt-good { color: var(--green); font-weight: 500; }


/* ─── Trust ─── */

.trust-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 48px;
    margin: 40px auto 0;
    max-width: 800px;
}

.trust-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.6;
}

.trust-item strong {
    color: var(--text);
}


/* ─── CTA ─── */

.cta-section {
    text-align: center;
    background: var(--text);
    color: #fff;
}

.cta-section .section-title {
    color: #fff;
}

.cta-section .section-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: #ddd;
}

.cta-terminal {
    max-width: 480px;
    margin: 40px auto;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    text-align: left;
    border: 1px solid rgba(255,255,255,0.1);
}

.term-bar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.term-code {
    padding: 16px;
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: #ccc;
    line-height: 1.75;
    margin: 0;
    overflow-x: auto;
}

.tc { color: #666; }
.tp { color: #4ade80; user-select: none; }

.cta-section .btn-primary {
    background: #fff;
    color: var(--text);
    margin-top: 8px;
}

.cta-section .btn-primary:hover {
    opacity: 0.9;
}


/* ─── Footer ─── */

footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-3);
}

.footer-name {
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.footer-inner a {
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.15s;
}

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


/* ─── Responsive ─── */

@media (max-width: 768px) {
    .demo-footer { flex-direction: column; gap: 4px; }
    .tools-grid { grid-template-columns: 1fr; }
    .eco-row { grid-template-columns: 1fr; gap: 48px; }
    .features { grid-template-columns: 1fr; }
    .trust-list { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .alt-row { grid-template-columns: 1fr; gap: 4px; }
    .alt-header { display: none; }
    .problem-item { flex-direction: column; gap: 4px; }
}

@media (max-width: 480px) {
    .hero { padding: 110px 0 60px; }
    .hero-title { font-size: 2rem; }
    .section { padding: 72px 0; }
    .nav-links a:not(.nav-gh) { display: none; }
    .hero-actions { flex-direction: column; align-items: center; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}
