/* ═══════════════════════════════════════════════════════════════
   NYX DESIGN SYSTEM v2.1 — Light
   Shared CSS for nyxlang.com, nyxkv.com, serve.nyxlang.com, proxy.nyxlang.com
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Color Tokens ─── */
:root {
    /* Palette */
    --nyx-violet:     #7c3aed;
    --nyx-blue:       #2563eb;
    --nyx-green:      #059669;
    --nyx-amber:      #d97706;
    --nyx-pink:       #db2777;
    --nyx-gray:       #6b7280;
    --nyx-gray-light: #9ca3af;

    /* Surfaces */
    --bg-main:     #ffffff;
    --bg-surface:  #f4f4f5;
    --bg-code:     #f0f0f2;
    --bg-nav:      rgba(255, 255, 255, 0.88);
    --bg-terminal: #0a0a0a;

    /* Text */
    --text-primary:   #111111;
    --text-secondary: #555555;
    --text-dim:       #a3a3a3;

    /* Borders */
    --border:       rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);

    /* Accent — unified teal */
    --accent:       #0891b2;
    --accent-hover: #0e7490;

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

/* ─── Base ─── */
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: var(--font-display);
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─── Nav ─── */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 0.75rem 2rem;
    background: var(--bg-nav);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo .product { font-weight: 400; color: var(--text-secondary); }

.nav-right { display: flex; gap: 0.25rem; align-items: center; }
.nav-right a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 150ms ease, background 150ms ease;
}
.nav-right a:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.nav-lang { font-size: 0.8rem; color: var(--text-dim); padding: 0 4px; }
.nav-lang a { color: var(--text-dim); padding: 4px 6px; }
.nav-lang a.active { color: var(--accent); font-weight: 600; }

/* ─── Buttons ─── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 150ms ease;
    border: none;
    cursor: pointer;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    text-decoration: none;
}

/* ─── Sections ─── */
section {
    padding: 5rem 2rem;
    max-width: 960px;
    margin: 0 auto;
    overflow-x: hidden;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 560px;
    line-height: 1.7;
}

/* ─── Hero ─── */
.hero {
    padding-top: 10rem;
    padding-bottom: 5rem;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.hero-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}

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

.hero-buttons { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ─── Cards ─── */
.card-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 150ms ease;
}
.card:hover { border-color: rgba(8, 145, 178, 0.25); }
.card a { text-decoration: none; }

.card-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.card-stat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* ─── Code Blocks ─── */
pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-primary);
    tab-size: 4;
    max-width: 100%;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* Syntax highlighting — Nyx official palette */
.kw  { color: var(--nyx-violet); }
.fn  { color: var(--nyx-blue); }
.str { color: var(--nyx-green); }
.num { color: var(--nyx-amber); }
.ty  { color: var(--nyx-pink); }
.cm  { color: var(--nyx-gray-light); }
.op  { color: var(--nyx-gray); }

/* ─── Terminal ─── */
.terminal {
    background: var(--bg-terminal);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.04);
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal pre {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem 1.4rem 1.4rem;
    color: #e5e5e5;
}

/* Terminal syntax */
.prompt  { color: var(--nyx-violet); }
.cmd     { color: #e5e5e5; }
.result  { color: var(--nyx-green); }
.comment { color: var(--nyx-gray); }

/* ─── Terminal Typing Animation ─── */
@keyframes nyx-fadein {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.t-line {
    opacity: 0;
    animation: nyx-fadein 0.25s ease forwards;
}
.t-line:nth-child(1) { animation-delay: 0.2s; }
.t-line:nth-child(2) { animation-delay: 0.7s; }
.t-line:nth-child(3) { animation-delay: 1.1s; }
.t-line:nth-child(4) { animation-delay: 1.5s; }
.t-line:nth-child(5) { animation-delay: 2.0s; }
.t-line:nth-child(6) { animation-delay: 2.5s; }
.t-line:nth-child(7) { animation-delay: 3.0s; }
.t-line:nth-child(8) { animation-delay: 3.5s; }
.t-line:nth-child(9) { animation-delay: 4.0s; }

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: -1px;
}

.tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 150ms ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

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

/* ─── Pricing Table ─── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.price-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
}
.price-card.featured { border-color: var(--accent); }

.price-name {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.price-amount {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.3rem;
}

.price-period {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.price-features {
    list-style: none;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.price-features li { padding: 0.3rem 0; }
.price-features li::before {
    content: "\2713";
    color: var(--nyx-green);
    margin-right: 0.5rem;
    font-weight: 700;
}

/* ─── Bench Bars ─── */
.bench-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.bench-name {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 120px;
    flex-shrink: 0;
}

.bench-bar-wrap {
    flex: 1;
    height: 24px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bench-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 600ms ease;
}

.bench-bar.c-bar { background: var(--nyx-gray); }

.bench-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

/* ─── Footer ─── */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.footer-col a {
    display: block;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 0.15rem 0;
    transition: color 150ms ease;
}
.footer-col a:hover { color: var(--text-secondary); text-decoration: none; }

.footer-bottom {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ─── Get Started Components ─── */

.gs-install {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}
.gs-install code { flex: 1; color: var(--text-primary); }

.btn-copy {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    flex-shrink: 0;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

.gs-note {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

.gs-subsection { margin-top: 2.5rem; }
.gs-subsection-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.gs-steps { display: flex; flex-direction: column; gap: 2rem; margin-top: 1.25rem; }
.gs-step-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.example-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 150ms ease;
    cursor: pointer;
}
.example-card:hover { border-color: rgba(8, 145, 178, 0.25); }

.example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    user-select: none;
}
.example-title { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.example-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }
.example-chevron { color: var(--text-dim); font-size: 0.65rem; transition: transform 200ms ease; flex-shrink: 0; }
.example-card.open .example-chevron { transform: rotate(180deg); }

.example-code { display: none; border-top: 1px solid var(--border); }
.example-card.open .example-code { display: block; }
.example-code pre { border-radius: 0; border: none; margin: 0; }

.gs-learn { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.gs-learn-note { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.75rem; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .card-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    nav { padding: 0.6rem 1rem; }
    .nav-logo { font-size: 1.2rem; }
    .nav-right { gap: 0; }
    .nav-right a.hide-mobile { display: none; }

    .hero { padding-top: 7rem; padding-bottom: 3rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero .subtitle { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .hero-buttons .btn { width: 100%; text-align: center; }

    section { padding: 3rem 1.2rem; }
    .section-title { font-size: 1.5rem; }

    .card-grid.cols-2,
    .card-grid.cols-3,
    .card-grid.cols-4,
    .card-grid.cols-5 { grid-template-columns: 1fr; }

    .pricing-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }

    pre { font-size: 0.75rem; padding: 1rem; }
    .terminal pre { font-size: 0.75rem; padding: 0.8rem 1rem; }

    .bench-name { width: 80px; font-size: 0.7rem; }
}

@media (max-width: 375px) {
    .hero h1 { font-size: 1.8rem; }
    .nav-logo { font-size: 1.1rem; }
    .footer-grid { grid-template-columns: 1fr; }
}
