/* ============================================================
   NyxKV — product identity stylesheet (dark, single-theme)
   Part of the Nyx product family (see nyx-serve's serve.css):
   shared dark dev-tool base, per-product accent. NyxKV's accent
   is emerald — the OK/stored/persisted green of a data store.
   Type: Inter (display) + JetBrains Mono (terminal, protagonist).
   ============================================================ */

:root {
    --bg: #0a0f0d;
    --bg-raise: #10171400;
    --bg-raise-solid: #101714;
    --bg-code: #0b1310;
    --bg-inline: #14201b;
    --border: #1a2621;
    --border-strong: #26372f;

    --ink: #e6efe9;
    --ink-2: #97a89f;
    --ink-dim: #5c6b63;

    --accent: #34d399;          /* emerald — stored / OK / alive */
    --accent-strong: #10b981;
    --accent-ink: #04140d;
    --accent-soft: rgba(52, 211, 153, 0.12);

    /* terminal syntax (dark) */
    --prompt: #34d399;
    --cmd: #e6efe9;
    --result: #7dd3fc;
    --comment: #5c6b63;
    --syn-kw: #b3a5ff;
    --syn-fn: #7db4ff;
    --syn-str: #7ee0a8;
    --syn-num: #f6c667;
    --syn-ty: #f5a3d0;

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

    --maxw: 1040px;

    /* aliases for inline styles carried over from the old design system */
    --text-secondary: var(--ink-2);
    --text-primary: var(--ink);
    --accent-hover: var(--accent-strong);
}

/* headings inside prose blocks (quick-start steps use inline h3) */
h3 { color: var(--ink); }
h3 a, p a { color: var(--accent); }
h3 a:hover, p a:hover { color: var(--accent-strong); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 16px; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }

/* subtle emerald glow behind the hero */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(60% 40% at 50% -8%, rgba(52,211,153,0.10), transparent 70%);
}

/* ---------- nav ---------- */
nav {
    position: fixed; top: 0; z-index: 50; width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 2rem;
    background: rgba(10, 15, 13, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--font-mono); font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.nav-logo::before { content: "◆ "; color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1.4rem; font-size: 0.92rem; color: var(--ink-2); }
.nav-right a:hover { color: var(--ink); }
.nav-lang { color: var(--ink-dim); font-size: 0.85rem; }
.nav-lang a.active { color: var(--ink); }

/* ---------- layout ---------- */
section { padding: 4.2rem 2rem; max-width: var(--maxw); margin: 0 auto; }

.section-label, .hero-label {
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.section-title { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 0.55rem; text-wrap: balance; }
.section-subtitle { color: var(--ink-2); margin-top: 0.65rem; max-width: 60ch; }

/* ---------- hero ---------- */
.hero { max-width: 760px; margin: 0 auto; padding: 9rem 2rem 2.5rem; text-align: center; }
.hero-label { display: inline-block; }
.hero h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.2rem); font-weight: 800;
    letter-spacing: -0.035em; line-height: 1.08; margin-top: 1rem; text-wrap: balance;
}
.hero h1 br { display: block; }
.hero .subtitle { color: var(--ink-2); margin: 1.1rem auto 0; font-size: 1.05rem; max-width: 52ch; }
.hero .subtitle code { color: var(--accent); }
.hero-buttons { display: flex; gap: 0.8rem; margin-top: 1.8rem; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block; padding: 0.62rem 1.3rem; border-radius: 6px;
    font-weight: 600; font-size: 0.94rem; border: 1px solid transparent;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-outline { border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-dim); }

/* ---------- terminal ---------- */
.terminal {
    background: var(--bg-code); border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 24px 60px -34px rgba(0,0,0,0.85);
    max-width: 720px; margin-left: auto; margin-right: auto;
}
.terminal-bar {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--bg-raise-solid);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #3d4d47; }
.terminal-dot.yellow { background: #3d4d47; }
.terminal-dot.green { background: var(--accent-strong); }
.terminal pre, pre {
    font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7;
    padding: 1.3rem 1.5rem; overflow-x: auto; color: var(--ink-2);
    background: var(--bg-code); border: none;
}
pre { border: 1px solid var(--border); border-radius: 10px; }
.terminal pre { border: none; border-radius: 0; }

code {
    font-family: var(--font-mono); font-size: 0.85em;
    background: var(--bg-inline); border: 1px solid var(--border);
    border-radius: 4px; padding: 0.1em 0.4em; color: var(--ink);
}
pre code { background: none; border: none; padding: 0; }

/* terminal + syntax spans */
.prompt { color: var(--prompt); user-select: none; }
.cmd { color: var(--cmd); }
.result { color: var(--result); }
.comment { color: var(--comment); }
.kw { color: var(--syn-kw); } .fn { color: var(--syn-fn); }
.str { color: var(--syn-str); } .num { color: var(--syn-num); }
.ty { color: var(--syn-ty); }

/* ---------- client tabs ---------- */
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.tab {
    font-family: var(--font-mono); font-size: 0.82rem;
    padding: 0.4rem 0.9rem; border-radius: 6px;
    background: var(--bg-raise-solid); border: 1px solid var(--border);
    color: var(--ink-2); cursor: pointer; transition: all 0.12s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent-soft); border-color: rgba(52,211,153,0.4); color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- cards ---------- */
.card-grid { display: grid; gap: 1rem; margin-top: 1.6rem; }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
    display: block; background: var(--bg-raise-solid); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.25rem 1.35rem; transition: border-color 0.15s ease;
}
a.card:hover { border-color: var(--border-strong); }
.card-title { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.card-title::before { content: ""; }
.card-desc { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.45rem; }
.card-stat { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; margin-top: 0.6rem; }

/* ---------- stats band ---------- */
.stats-inner {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-raise-solid); overflow: hidden; margin-top: 0;
}
.stat { padding: 1.35rem 1.2rem; border-left: 1px solid var(--border); }
.stat:first-child { border-left: none; }
.stat .n { font-family: var(--font-mono); font-size: 1.4rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .n em { font-style: normal; color: var(--accent); }
.stat .l { font-size: 0.8rem; color: var(--ink-dim); margin-top: 0.15rem; }

/* ---------- benchmark table ---------- */
.bench {
    width: 100%; border-collapse: collapse; margin-top: 1.6rem; font-size: 0.9rem;
    display: block; overflow-x: auto;
}
.bench th, .bench td { border: 1px solid var(--border); padding: 0.55rem 0.9rem; text-align: right; }
.bench th:first-child, .bench td:first-child { text-align: left; }
.bench th { background: var(--bg-raise-solid); color: var(--ink); font-weight: 600; }
.bench td { color: var(--ink-2); font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 0.85rem; }
.bench td.win { color: var(--accent); }
.bench caption { color: var(--ink-dim); font-size: 0.82rem; text-align: left; margin-top: 0.7rem; caption-side: bottom; }

/* ---------- pricing ---------- */
.price-card {
    background: var(--bg-raise-solid); border: 1px solid var(--accent);
    border-radius: 14px; padding: 2rem; text-align: center;
    box-shadow: 0 0 0 1px rgba(52,211,153,0.15), 0 30px 60px -40px rgba(16,185,129,0.4);
}
.price-name { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; }
.price-amount { font-size: 3rem; font-weight: 800; margin-top: 0.4rem; letter-spacing: -0.03em; }
.price-period { color: var(--ink-dim); font-size: 0.9rem; }
.price-features { list-style: none; margin: 1.5rem 0 0; text-align: left; }
.price-features li { padding: 0.4rem 0; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 0.94rem; }
.price-features li:first-child { border-top: none; }
.price-features li strong { color: var(--ink); }
.price-features li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 3rem 2rem 2.5rem; max-width: var(--maxw); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-dim); margin-bottom: 0.7rem; }
.footer-col a { display: block; color: var(--ink-2); font-size: 0.9rem; padding: 0.2rem 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; color: var(--ink-dim); font-size: 0.85rem; }
.footer-bottom a { color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .card-grid.cols-3 { grid-template-columns: 1fr; }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .stat { border-top: 1px solid var(--border); }
    .stat:nth-child(-n+2) { border-top: none; }
    .stat:nth-child(odd) { border-left: none; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .hide-mobile { display: none; }
    .hero { padding-top: 7rem; }
}
