/* ════════════════════════════════════════
   Blog técnico — manosjd.com
   Comparte el lenguaje visual de index.html
   ════════════════════════════════════════ */
:root {
    --bg:           #0a0a0a;
    --bg-soft:      #0e0e0e;
    --bg-card:      #121212;
    --bg-card-h:    #181818;
    --accent:       #00ff88;
    --accent-dark:  #00cc6e;
    --accent-dim:   rgba(0,255,136,.08);
    --accent-glow:  rgba(0,255,136,.25);
    --text:         #ededed;
    --text-dim:     #9a9a9a;
    --text-faint:   #5a5a5a;
    --border:       rgba(255,255,255,.07);
    --border-h:     rgba(0,255,136,.28);
    --mono:         'JetBrains Mono', monospace;
    --sans:         'Inter', sans-serif;
    --display:      'Space Grotesk', sans-serif;
    --radius:       16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    overflow-x: hidden;
}
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ════════ Progress ════════ */
#progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), #00ccff);
    z-index: 300;
    transition: width .1s linear;
}

/* ════════ Nav ════════ */
nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: rgba(10,10,10,.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}
.nav-logo {
    font-family: var(--mono);
    color: var(--accent);
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -.02em;
}
.nav-right { display: flex; align-items: center; gap: 1.4rem; }
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: .86rem;
    transition: color .2s;
}
.nav-link:hover { color: var(--accent); }
.nav-cta {
    font-size: .82rem;
    font-weight: 600;
    background: var(--accent);
    color: #000;
    padding: .45rem 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all .2s;
}
.nav-cta:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* ════════ Layout ════════ */
.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 3.5rem;
    align-items: start;
}

/* ════════ Cabecera de artículo / índice ════════ */
.crumb {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--text-faint);
    margin-bottom: 1.6rem;
}
.crumb .t-prompt { color: var(--accent); }
.crumb .t-cmd { color: var(--text); }
.section-tag {
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--accent);
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-bottom: .6rem;
    opacity: .85;
}
h1.post-title {
    font-family: var(--display);
    font-size: clamp(1.7rem, 4.5vw, 2.7rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
}
.post-subtitle {
    color: var(--text-dim);
    font-size: 1.02rem;
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 1.6rem;
}
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 2.6rem;
}
.meta-chip {
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--text-dim);
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .28rem .8rem;
    letter-spacing: .03em;
}
.meta-chip.hl { color: var(--accent); background: var(--accent-dim); border-color: rgba(0,255,136,.18); }

/* ════════ Stats strip ════════ */
.post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1.3rem 1.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 2.8rem;
}
.stat-item { display: flex; flex-direction: column; }
.stat-n {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.25;
}
.stat-l { font-size: .74rem; color: var(--text-faint); }

/* ════════ Cuerpo del artículo ════════ */
.post { min-width: 0; }
.post h2 {
    font-family: var(--display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 2.8rem 0 1rem;
    padding-top: .6rem;
    scroll-margin-top: 90px;
}
.post h2 .hash { color: var(--accent); margin-right: .45rem; font-family: var(--mono); font-size: 1.1rem; }
.post p {
    color: var(--text-dim);
    font-size: .98rem;
    line-height: 1.85;
    margin-bottom: 1.15rem;
}
.post p strong, .post li strong { color: var(--text); font-weight: 600; }
.post ul { margin: 0 0 1.15rem 1.2rem; }
.post li {
    color: var(--text-dim);
    font-size: .98rem;
    line-height: 1.8;
    margin-bottom: .6rem;
}
.post li::marker { color: var(--accent); }
.post code {
    font-family: var(--mono);
    font-size: .82em;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,255,136,.14);
    border-radius: 5px;
    padding: .12em .4em;
    white-space: nowrap;
}
.post .codeblock {
    position: relative;
    margin: 1.4rem 0 1.6rem;
}
.post pre {
    background: #0c0c0c;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: .8rem;
    line-height: 1.7;
    color: var(--text);
}
.post pre code { background: none; border: none; padding: 0; color: inherit; white-space: pre; font-size: 1em; }
.copy-btn {
    position: absolute;
    top: .6rem; right: .6rem;
    font-family: var(--mono);
    font-size: .68rem;
    background: rgba(255,255,255,.05);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: .3rem .7rem;
    cursor: pointer;
    transition: all .2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.callout {
    margin: 1.4rem 0 1.6rem;
    padding: 1rem 1.2rem;
    background: var(--accent-dim);
    border-left: 2px solid var(--accent);
    border-radius: 0 10px 10px 0;
    color: var(--text-dim);
    font-size: .93rem;
    line-height: 1.75;
}
.callout strong { color: var(--accent); }

.post-footer {
    margin-top: 3rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    color: var(--text-faint);
    font-style: italic;
}

/* ════════ TOC ════════ */
.toc {
    position: sticky;
    top: 100px;
    font-size: .82rem;
}
.toc-title {
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--text-faint);
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: .8rem;
}
.toc ol { list-style: none; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    padding: .38rem 0 .38rem 1rem;
    border-left: 2px solid transparent;
    margin-left: -1px;
    line-height: 1.45;
    transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-mobile { display: none; }

/* ════════ Índice del blog (listado) ════════ */
.post-card {
    display: block;
    background: linear-gradient(160deg, var(--bg-card) 0%, #0d0d0d 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform .3s, border-color .3s, box-shadow .3s;
    margin-bottom: 1.4rem;
}
.post-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent 60%);
    opacity: 0;
    transition: opacity .3s;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--border-h); box-shadow: 0 24px 55px rgba(0,0,0,.5); }
.post-card:hover::before { opacity: 1; }
.post-card h2 {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
    margin: .5rem 0 .7rem;
    line-height: 1.3;
}
.post-card .excerpt {
    color: var(--text-dim);
    font-size: .92rem;
    line-height: 1.7;
    margin-bottom: 1.1rem;
}
.post-card .read-more {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--accent);
}
.coming-soon {
    text-align: center;
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--text-faint);
    padding: 2.2rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ════════ Footer ════════ */
footer { border-top: 1px solid var(--border); padding: 2rem; text-align: center; margin-top: 4rem; }
footer p { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); line-height: 1.8; }
footer span { color: var(--accent); }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent); }

/* ════════ Animaciones ════════ */
.fade {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s ease, transform .6s ease;
}
.fade.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* ════════ Responsive ════════ */
@media (max-width: 1000px) {
    .layout { grid-template-columns: 1fr; gap: 0; }
    .toc { display: none; }
    .toc-mobile {
        display: block;
        margin-bottom: 2.2rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: .9rem 1.1rem;
    }
    .toc-mobile summary {
        font-family: var(--mono);
        font-size: .74rem;
        color: var(--accent);
        letter-spacing: .1em;
        text-transform: uppercase;
        cursor: pointer;
    }
    .toc-mobile ol { list-style: none; margin-top: .8rem; }
    .toc-mobile a {
        display: block;
        color: var(--text-dim);
        text-decoration: none;
        padding: .4rem 0;
        font-size: .86rem;
        border-bottom: 1px solid var(--border);
    }
    .toc-mobile li:last-child a { border-bottom: none; }
    .toc-mobile a:hover { color: var(--accent); }
}
@media (max-width: 640px) {
    nav { padding: 1rem 1.3rem; }
    .nav-link.hide-sm { display: none; }
    .page { padding: 105px 1.2rem 3rem; }
    .post-stats { gap: 1.3rem; padding: 1.1rem 1.2rem; }
}
