:root {
    --nx-color-primary: #C8102E;
    --nx-color-primary-hover: #A50D25;
    --nx-color-on-primary: #ffffff;
    --nx-color-surface: #ffffff;
    --nx-color-text: #1a1a1a;
    --nx-color-border: #e8e2d5;
    --nx-gold: #C99A2E;
    --nx-gold-bright: #E8C158;
    --nx-black: #0B0B0C;
    --nx-green: #1E8F5F;
    --nx-cream: #FAF7F0;
    --nx-shadow-sm: 0 2px 8px rgba(20, 15, 5, 0.06);
    --nx-shadow-md: 0 10px 30px rgba(20, 15, 5, 0.08);
    --nx-shadow-lg: 0 24px 60px rgba(20, 15, 5, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--nx-cream);
    color: var(--nx-color-text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.nx-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.nx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: var(--nx-black);
    border-bottom: 1px solid rgba(201, 154, 46, 0.35);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 10;
}
.nx-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.nx-brand img { display: block; }
.nx-brand-word {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.nx-nav { display: flex; align-items: center; gap: 1.75rem; }
.nx-nav a {
    color: #cfcfcf;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.nx-nav a:hover { color: var(--nx-gold-bright); }
.nx-nav-github {
    border: 1px solid var(--nx-gold);
    padding: 0.4rem 0.9rem;
    border-radius: 7px;
    color: #fff !important;
}
.nx-nav-github:hover { background: rgba(201, 154, 46, 0.15); }
.nx-lang-switch { display: flex; gap: 0.35rem; color: #666; font-size: 0.85rem; }
.nx-lang-switch a { color: #aaa; font-weight: 600; }
.nx-lang-switch a:hover { color: var(--nx-gold-bright); }

/* Hero — layout dividido en dos columnas */
.nx-hero {
    padding: 4.5rem 2rem;
    background:
        radial-gradient(50% 80% at 15% 20%, rgba(200, 16, 46, 0.18), transparent 60%),
        linear-gradient(180deg, #17110d 0%, var(--nx-black) 80%);
    color: #fff;
}
.nx-hero-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
    align-items: center;
}
.nx-hero-copy { text-align: left; }
.nx-kicker {
    display: inline-block;
    color: var(--nx-gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
}
.nx-kicker-light { color: var(--nx-color-primary); }
.nx-hero h1 {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    line-height: 1.15;
    margin: 0 0 1.3rem;
    background: linear-gradient(90deg, #fff 30%, var(--nx-gold-bright) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nx-hero-sub {
    max-width: 520px;
    margin: 0 0 2.2rem;
    color: #cfcfcf;
    font-size: 1.08rem;
}
.nx-hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.nx-hero-ctas .nx-btn { font-weight: 600; padding: 0.8rem 1.6rem; font-size: 1rem; }
.nx-hero-ctas .nx-btn-primary { box-shadow: 0 8px 24px rgba(200, 16, 46, 0.35); }
.nx-hero-ctas .nx-btn:not(.nx-btn-primary) {
    background: transparent;
    border: 1px solid var(--nx-gold);
    color: var(--nx-gold-bright);
}
.nx-hero-ctas .nx-btn:not(.nx-btn-primary):hover { background: rgba(201, 154, 46, 0.15); }

/* Panel de código — como una ventana de editor */
.nx-hero-panel { min-width: 0; }
.nx-window {
    background: var(--nx-black);
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--nx-shadow-lg);
}
.nx-window-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    background: #161616;
    border-bottom: 1px solid #262626;
}
.nx-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nx-dot-r { background: #e0524a; }
.nx-dot-y { background: #e0b64a; }
.nx-dot-g { background: #52b565; }
.nx-window-title { margin-left: 0.6rem; color: #888; font-size: 0.8rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nx-window pre {
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.nx-page pre {
    background: var(--nx-black);
    color: #eee;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 1.4rem 1.6rem;
    overflow-x: auto;
    font-size: 0.9rem;
    box-shadow: var(--nx-shadow-lg);
}
.nx-window code, .nx-page code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}
.nx-window pre {
    padding: 1.4rem 1.6rem;
    overflow-x: auto;
    font-size: 0.86rem;
    color: #eee;
}
.nx-page :not(pre) > code {
    background: #f0ebe0;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-size: 0.9em;
}

/* Stats strip */
.nx-stats { background: #fff; border-bottom: 1px solid var(--nx-color-border); padding: 2.75rem 1.5rem; }
.nx-stats-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    text-align: center;
}
.nx-stat-num {
    display: block;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--nx-color-primary);
    line-height: 1.1;
}
.nx-stat-label { display: block; color: #666; font-size: 0.88rem; margin-top: 0.4rem; }

/* Advantages grid */
.nx-advantages { max-width: 1100px; margin: 5rem auto; padding: 0 1.5rem; text-align: center; }
.nx-advantages h2, .nx-story h2 { text-align: center; font-size: 1.9rem; margin: 0 0 2.5rem; }
.nx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; text-align: left; }
.nx-grid .nx-card {
    position: relative;
    border: 1px solid var(--nx-color-border);
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem 1.75rem 1.9rem;
    box-shadow: var(--nx-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.nx-grid .nx-card:hover { box-shadow: var(--nx-shadow-md); transform: translateY(-3px); }
.nx-card-num {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--nx-gold);
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.nx-grid .nx-card-title {
    color: var(--nx-color-text);
    font-size: 1.08rem;
    margin: 0 0 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--nx-gold);
    display: inline-block;
}
.nx-grid .nx-card p { color: #4a4a4a; font-size: 0.95rem; margin: 0; line-height: 1.6; }

/* Story */
.nx-story {
    max-width: 760px;
    margin: 0 auto 4.5rem;
    padding: 2.25rem 2.25rem;
    display: flex;
    gap: 1.75rem;
    align-items: center;
    background: #fff;
    border: 1px solid var(--nx-color-border);
    border-radius: 16px;
    box-shadow: var(--nx-shadow-sm);
}
.nx-story img { flex-shrink: 0; }
.nx-story h2 { text-align: left; font-size: 1.25rem; margin: 0 0 0.6rem; }
.nx-story p { margin: 0; color: #4a4a4a; }

/* Language gate */
.nx-gate {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 4rem 1.5rem;
    text-align: center;
    background:
        radial-gradient(55% 70% at 50% 15%, rgba(200, 16, 46, 0.18), transparent 60%),
        linear-gradient(180deg, #17110d 0%, var(--nx-black) 80%);
    color: #fff;
}
.nx-gate .nx-kicker { margin-bottom: 0.5rem; }
.nx-gate h1 { font-size: 2.3rem; margin: 0.9rem 0 0.4rem; letter-spacing: 0.01em; color: #fff; }
.nx-gate-tagline { max-width: 560px; color: #cfcfcf; font-size: 1.02rem; margin: 0 0 2rem; line-height: 1.6; }
.nx-gate-sep { color: var(--nx-gold); margin: 0 0.3rem; }
.nx-gate-label {
    color: var(--nx-gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
}
.nx-gate-links { display: flex; gap: 1rem; }
.nx-gate-links .nx-btn { padding: 0.75rem 1.85rem; font-weight: 600; box-shadow: 0 8px 24px rgba(200, 16, 46, 0.35); }

/* Footer */
.nx-footer {
    margin-top: auto;
    background: var(--nx-black);
    color: #999;
    text-align: center;
    padding: 2.5rem 1rem;
    font-size: 0.85rem;
}
.nx-footer img { opacity: 0.85; margin-bottom: 0.75rem; }
.nx-footer p { margin: 0.25rem 0; }
.nx-footer-license { color: #666; }

/* Compatibility + tutorial content pages */
.nx-page { max-width: 800px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }
.nx-page h1 { font-size: 2.2rem; margin-bottom: 0.6rem; }
.nx-page > p:first-of-type { color: #555; font-size: 1.08rem; }
.nx-page section {
    margin-top: 1.75rem;
    background: #fff;
    border: 1px solid var(--nx-color-border);
    border-radius: 14px;
    padding: 1.75rem 2rem 2rem;
    box-shadow: var(--nx-shadow-sm);
}
.nx-page section h2 { font-size: 1.25rem; border-bottom: 2px solid var(--nx-gold); display: inline-block; padding-bottom: 0.25rem; margin-bottom: 0.9rem; }
.nx-page section p { color: #333; margin-top: 0.9rem; }

/* Tutorial hub */
.nx-tutorial-hub { max-width: 920px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; text-align: center; }
.nx-tutorial-hub h1 { font-size: 2.2rem; }
.nx-tutorial-hub > p { color: #555; max-width: 600px; margin: 0.5rem auto 2.75rem; }
.nx-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; text-align: left; }
.nx-step-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--nx-color-border);
    border-radius: 12px;
    padding: 1.15rem 1.4rem 1.3rem;
    box-shadow: var(--nx-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.nx-step-card:hover { border-color: var(--nx-color-primary); box-shadow: var(--nx-shadow-md); transform: translateY(-3px); }
.nx-step-num {
    display: inline-block;
    color: var(--nx-color-primary);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}
.nx-step-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.4; }

/* Tutorial: layout con menú lateral */
.nx-tutorial-layout {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2.5rem;
    align-items: start;
}
.nx-tutorial-layout .nx-page {
    max-width: none;
    margin: 0;
    padding: 3.5rem 0 5rem;
}
.nx-toc {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: #fff;
    border: 1px solid var(--nx-color-border);
    border-radius: 14px;
    padding: 1.1rem;
    margin-top: 3.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
}
.nx-toc-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    font-weight: 700;
    margin: 0.3rem 0 0.6rem 0.6rem;
}
.nx-toc a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-size: 0.87rem;
    line-height: 1.35;
}
.nx-toc a:hover { background: #f2ede0; }
.nx-toc a.active { background: var(--nx-color-primary); color: #fff; font-weight: 600; }
.nx-toc-num { flex-shrink: 0; min-width: 1.3rem; color: var(--nx-gold); font-weight: 700; font-size: 0.76rem; }
.nx-toc a.active .nx-toc-num { color: rgba(255, 255, 255, 0.85); }

/* Tutorial page article */
.nx-tutorial-step .nx-step-badge {
    display: inline-block;
    background: var(--nx-green);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}
.nx-tutorial-step section h2 { font-size: 1.15rem; }
.nx-tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--nx-color-border);
}
.nx-tutorial-nav a { color: var(--nx-color-primary); text-decoration: none; font-weight: 600; }
.nx-tutorial-nav a:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .nx-hero-grid { grid-template-columns: 1fr; }
    .nx-hero-copy { text-align: center; }
    .nx-hero-sub { margin-left: auto; margin-right: auto; }
    .nx-hero-ctas { justify-content: center; }
    .nx-tutorial-layout { grid-template-columns: 1fr; }
    .nx-toc { position: static; max-height: none; margin-top: 1.5rem; order: -1; }
    .nx-tutorial-layout .nx-page { padding-top: 1.5rem; }
}

@media (max-width: 640px) {
    .nx-header { flex-direction: column; gap: 0.75rem; padding: 1rem; }
    .nx-nav { flex-wrap: wrap; justify-content: center; gap: 0.9rem; }
    .nx-story { flex-direction: column; text-align: center; }
}
