/* =========================================================================
   Hijos de las Nieves — hoja de estilo unica del sitio publico.
   Usada por /, /guia/, /lore/ y /noticias/.

   Convenciones:
   - Tokens en :root. Tema oscuro por defecto (identidad de marca).
     Tema claro si el sistema lo pide, o si el usuario lo fuerza con el
     conmutador (atributo data-theme en <html>, persistido en localStorage).
   - Nada de frameworks ni build. CSS plano.
   - Las clases .btn, .btn-primary, .icon y .download-meta son CONTRATO con
     nginx: el bloque sub_filter inyecta HTML que las usa. No renombrar.
   ========================================================================= */

/* ---------- 1. Tokens ---------------------------------------------------- */

:root {
    color-scheme: dark;

    /* superficies */
    --bg:            #080b12;
    --bg-soft:       #0c111b;
    --surface:       #111826;
    --surface-2:     #161f30;
    --surface-glass: rgba(18, 26, 41, .72);

    /* trazos */
    --line:          rgba(167, 200, 245, .13);
    --line-strong:   rgba(167, 200, 245, .28);

    /* texto */
    --text:          #eef2f8;
    --text-muted:    #a9b5c7;
    --text-faint:    #7d8899;

    /* acentos */
    --ice:           #8cc0ff;
    --ice-soft:      #b9d8ff;
    --gold:          #dbb87f;
    --gold-soft:     #ecd6ab;
    --green:         #7ddcb0;
    --amber:         #edbe77;

    /* acentos sobre fondo: version usable como fondo de chip */
    --ice-wash:      rgba(140, 192, 255, .10);
    --gold-wash:     rgba(219, 184, 127, .10);
    --green-wash:    rgba(125, 220, 176, .10);
    --amber-wash:    rgba(237, 190, 119, .10);

    /* botones */
    --btn-primary-bg:   linear-gradient(180deg, #a8cfff 0%, #5d97dd 100%);
    --btn-primary-ink:  #06101f;
    --btn-ghost-bg:     rgba(255, 255, 255, .05);
    --btn-ghost-ink:    var(--text);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .3);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, .38);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, .45);

    --radius:    14px;
    --radius-sm: 9px;
    --radius-lg: 20px;

    --shell:     1180px;
    --gutter:    clamp(16px, 4vw, 40px);

    --font-display: 'Cinzel', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;

        --bg:            #f4f1ea;
        --bg-soft:       #efebe2;
        --surface:       #ffffff;
        --surface-2:     #faf8f3;
        --surface-glass: rgba(255, 255, 255, .82);

        --line:          rgba(32, 42, 58, .14);
        --line-strong:   rgba(32, 42, 58, .28);

        --text:          #141922;
        --text-muted:    #4c5666;
        --text-faint:    #6b7584;

        --ice:           #1a5aa3;
        --ice-soft:      #174b89;
        --gold:          #86601c;
        --gold-soft:     #6d4d12;
        --green:         #156b4a;
        --amber:         #845410;

        --ice-wash:      rgba(26, 90, 163, .09);
        --gold-wash:     rgba(134, 96, 28, .10);
        --green-wash:    rgba(21, 107, 74, .09);
        --amber-wash:    rgba(132, 84, 16, .09);

        --btn-primary-bg:  linear-gradient(180deg, #2b6fbd 0%, #1a5aa3 100%);
        --btn-primary-ink: #ffffff;
        --btn-ghost-bg:    rgba(20, 30, 45, .04);

        --shadow-sm: 0 2px 8px rgba(26, 36, 52, .07);
        --shadow-md: 0 14px 36px rgba(26, 36, 52, .10);
        --shadow-lg: 0 26px 64px rgba(26, 36, 52, .13);
    }
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg:            #f4f1ea;
    --bg-soft:       #efebe2;
    --surface:       #ffffff;
    --surface-2:     #faf8f3;
    --surface-glass: rgba(255, 255, 255, .82);

    --line:          rgba(32, 42, 58, .14);
    --line-strong:   rgba(32, 42, 58, .28);

    --text:          #141922;
    --text-muted:    #4c5666;
    --text-faint:    #6b7584;

    --ice:           #1a5aa3;
    --ice-soft:      #174b89;
    --gold:          #86601c;
    --gold-soft:     #6d4d12;
    --green:         #156b4a;
    --amber:         #845410;

    --ice-wash:      rgba(26, 90, 163, .09);
    --gold-wash:     rgba(134, 96, 28, .10);
    --green-wash:    rgba(21, 107, 74, .09);
    --amber-wash:    rgba(132, 84, 16, .09);

    --btn-primary-bg:  linear-gradient(180deg, #2b6fbd 0%, #1a5aa3 100%);
    --btn-primary-ink: #ffffff;
    --btn-ghost-bg:    rgba(20, 30, 45, .04);

    --shadow-sm: 0 2px 8px rgba(26, 36, 52, .07);
    --shadow-md: 0 14px 36px rgba(26, 36, 52, .10);
    --shadow-lg: 0 26px 64px rgba(26, 36, 52, .13);
}

/* ---------- 2. Base ------------------------------------------------------ */

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

html {
    scroll-behavior: smooth;
    /* los anclas no quedan bajo la cabecera pegajosa */
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    /* clave para el responsive a 380px: nada se desborda lateralmente */
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.68;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--ice); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }

:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: .005em;
    color: var(--text);
    /* evita que un titulo largo rompa el layout a 380px */
    overflow-wrap: break-word;
}

p { overflow-wrap: break-word; }

code, kbd, samp, pre { font-family: var(--font-mono); }

code {
    font-size: .86em;
    padding: .1em .4em;
    border-radius: 5px;
    background: var(--ice-wash);
    color: var(--ice);
    overflow-wrap: anywhere;
}

kbd {
    display: inline-block;
    min-width: 1.9em;
    padding: .15em .5em;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .8em;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

::selection { background: var(--ice); color: var(--bg); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: .7rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 0 0 var(--radius-sm) 0;
    color: var(--text);
    text-decoration: none;
}
.skip-link:focus { left: 0; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- 3. Layout ---------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.shell--narrow { max-width: 820px; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section + .section { padding-top: 0; }

.section--band {
    background: var(--bg-soft);
    border-block: 1px solid var(--line);
}
.section + .section--band { padding-top: clamp(3.5rem, 8vw, 6.5rem); }

.section-head { max-width: 680px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .9rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ice);
}
.eyebrow--gold { color: var(--gold); }
.eyebrow .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex: none;
}
.eyebrow .dot--live { animation: hdn-pulse 2.4s ease-in-out infinite; }
@keyframes hdn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(125, 220, 176, .55); }
    60%      { box-shadow: 0 0 0 7px rgba(125, 220, 176, 0); }
}

.section-title {
    margin: 0 0 .85rem;
    font-size: clamp(1.65rem, 4.2vw, 2.45rem);
}
.lead {
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    font-weight: 400;
}
.lead strong { color: var(--text); font-weight: 600; }

/* ---------- 4. Cabecera y navegacion ------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--surface-glass);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    padding-block: .55rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-right: auto;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
}
.brand:hover { color: var(--gold); }
.brand__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px; height: 34px;
    border: 1px solid var(--gold);
    border-radius: 9px;
    background: var(--gold-wash);
    color: var(--gold);
}
.brand__mark svg { width: 17px; height: 17px; }

.site-nav { display: flex; align-items: center; gap: .15rem; }
.site-nav a {
    padding: .5rem .72rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--text); background: var(--ice-wash); }
.site-nav a[aria-current="page"] { color: var(--gold); }

.theme-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px; height: 38px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--btn-ghost-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--ice); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
}

/* En movil ocultamos los enlaces de la barra: el pie y el menu de pagina
   cubren la navegacion, y asi no hay scroll horizontal a 380px. */
@media (max-width: 760px) {
    .site-nav { display: none; }
    .brand__label-long { display: none; }
}

/* Navegacion secundaria movil: fila de pildoras bajo la cabecera. */
.mobile-nav { display: none; }
@media (max-width: 760px) {
    .mobile-nav {
        display: block;
        border-bottom: 1px solid var(--line);
        background: var(--bg-soft);
    }
    .mobile-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: .4rem;
        margin: 0;
        padding: .55rem var(--gutter);
        list-style: none;
    }
    .mobile-nav a {
        display: block;
        padding: .35rem .8rem;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
        color: var(--text-muted);
        text-decoration: none;
        font-size: .76rem;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        white-space: nowrap;
    }
    .mobile-nav a[aria-current="page"] {
        color: var(--gold);
        border-color: var(--gold);
        background: var(--gold-wash);
    }
}

/* ---------- 5. Botones --------------------------------------------------- */
/* .btn / .btn-primary / .icon / .download-meta: contrato con nginx sub_filter */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .82rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-ink);
    border-color: rgba(140, 192, 255, .45);
    box-shadow: 0 10px 28px rgba(45, 110, 190, .28);
}
.btn-primary:hover { color: var(--btn-primary-ink); box-shadow: 0 14px 34px rgba(45, 110, 190, .36); }

.btn-ghost {
    background: var(--btn-ghost-bg);
    color: var(--btn-ghost-ink);
    border-color: var(--line-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--ice); background: var(--ice-wash); }

.btn-sm { padding: .6rem 1.05rem; font-size: .86rem; }

.btn .icon { width: 18px; height: 18px; flex: none; }

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    align-items: center;
}

.download-meta {
    margin-top: 1.1rem;
    color: var(--text-faint);
    font-size: .82rem;
    line-height: 1.6;
    max-width: 44ch;
}
.download-meta code {
    background: var(--ice-wash);
    color: var(--ice);
}
.download-meta a { color: var(--ice); }

/* ---------- 6. Hero (portada) -------------------------------------------- */
/* El wordmark hdn1 es acero oscuro: necesita fondo oscuro SIEMPRE, tambien en
   tema claro. Por eso el hero conserva su tratamiento nocturno en los dos
   temas y solo el resto de la pagina cambia. */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #f0f3f8;
    background-color: #06080d;
}
.hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: 50% 42%;
    background-size: cover;
    background-repeat: no-repeat;
    background-image: url("/hdn3.png");
    background-image: image-set(url("/hdn3.webp") type("image/webp"), url("/hdn3.png") type("image/png"));
    filter: saturate(.70) brightness(.40) contrast(1.08);
}
@media (max-width: 760px) {
    .hero__media {
        background-image: url("/hdn3.png");
        background-image: image-set(url("/hdn3-1100.webp") type("image/webp"), url("/hdn3.png") type("image/png"));
    }
}
.hero__scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    /* El key art lleva el emblema HDN justo en el centro, donde va el
       wordmark. El velo radial oscurece esa zona para que el fondo quede
       como textura y no compita con la tipografia. */
    background:
        radial-gradient(ellipse 58% 46% at 50% 44%, rgba(6, 8, 13, .62) 0%, rgba(6, 8, 13, .10) 72%, transparent 100%),
        linear-gradient(180deg, rgba(6, 8, 13, .58) 0%, rgba(6, 8, 13, .34) 42%, rgba(6, 8, 13, .88) 84%, var(--bg) 100%);
}
.hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3.5rem, 9vw, 6.5rem);
}
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
    padding: .4rem 1rem;
    border: 1px solid rgba(219, 184, 127, .40);
    border-radius: 999px;
    background: rgba(8, 11, 18, .62);
    color: #ecd6ab;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero__eyebrow .dot { background: var(--green); }
/* El wordmark ES el h1: el texto accesible va en el alt de la imagen. */
.hero__title { margin: 0; line-height: 0; }
.hero__logo {
    width: clamp(260px, 68vw, 640px);
    margin: 0 auto clamp(1rem, 2.5vw, 1.6rem);
    filter: drop-shadow(0 10px 36px rgba(0, 0, 0, .7));
    user-select: none;
}
.hero__lead {
    max-width: 62ch;
    margin: 0 auto clamp(1.8rem, 4vw, 2.6rem);
    color: rgba(240, 243, 248, .80);
    font-size: clamp(1rem, 2vw, 1.14rem);
}
.hero__lead strong { color: #fff; font-weight: 600; }
.hero .cta-row { justify-content: center; }
.hero .download-meta {
    margin-inline: auto;
    color: rgba(240, 243, 248, .60);
    text-align: center;
}
.hero .download-meta code { background: rgba(140, 192, 255, .14); color: #b9d8ff; }
.hero .download-meta a { color: #b9d8ff; }
.hero .btn-ghost {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .26);
    color: #f0f3f8;
}
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .45); }

/* ---------- 7. Cabecera de paginas interiores ---------------------------- */

.page-hero {
    position: relative;
    padding-block: clamp(2.6rem, 6vw, 4.6rem) clamp(2rem, 5vw, 3.4rem);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(ellipse 80% 70% at 15% 0%, var(--ice-wash) 0%, transparent 65%),
        var(--bg-soft);
}
.page-hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 6vw, 3.3rem);
}
.page-hero .lead { max-width: 68ch; }
.page-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.4rem;
    margin-top: 1.6rem;
    color: var(--text-faint);
    font-size: .82rem;
}

/* ---------- 8. Tarjetas y rejillas --------------------------------------- */

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid > * { min-width: 0; }

.card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 {
    margin: 0 0 .5rem;
    font-size: 1.08rem;
    letter-spacing: .02em;
}
.card p { margin: 0; color: var(--text-muted); font-size: .93rem; }
.card p + p { margin-top: .7rem; }

.card__icon {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    margin-bottom: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--ice-wash);
    color: var(--ice);
}
.card__icon svg { width: 20px; height: 20px; }
.card--gold .card__icon { background: var(--gold-wash); color: var(--gold); border-color: var(--gold); }

.card__tag {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: .7rem;
    padding: .18rem .55rem;
    border-radius: 5px;
    background: var(--green-wash);
    color: var(--green);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.card__tag--soon { background: var(--amber-wash); color: var(--amber); }

/* chip compacto: icono + etiqueta, sin parrafo */
.chips {
    display: grid;
    gap: .7rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.chip {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .2s, background .2s;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px; height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--ice-wash);
    color: var(--ice);
}
.chip__icon svg { width: 16px; height: 16px; }
.chip span {
    min-width: 0;
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 500;
    letter-spacing: .03em;
    overflow-wrap: break-word;
}

/* ---------- 9. Pasos numerados (Tres Sendas, instalacion) ---------------- */

.steps {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    counter-reset: hdn-step;
}
.step {
    position: relative;
    min-width: 0;
    padding: 1.7rem 1.3rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.step::before {
    counter-increment: hdn-step;
    content: counter(hdn-step, decimal-leading-zero);
    position: absolute;
    top: -.8rem; left: 1.2rem;
    padding: .15rem .65rem;
    border-radius: 999px;
    background: var(--gold);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
}
:root[data-theme="light"] .step::before { color: #fff; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .step::before { color: #fff; }
}
.step h3 { margin: 0 0 .45rem; font-size: 1.05rem; color: var(--gold); }
.step p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* lista de pasos verticales, para la guia */
.steps-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: hdn-numlist;
}
.steps-list > li {
    position: relative;
    padding: 0 0 1.5rem 3.2rem;
    counter-increment: hdn-numlist;
}
.steps-list > li::before {
    content: counter(hdn-numlist);
    position: absolute;
    left: 0; top: .1rem;
    display: grid;
    place-items: center;
    width: 2.1rem; height: 2.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--ice-wash);
    color: var(--ice);
    font-family: var(--font-display);
    font-size: .85rem;
    font-weight: 700;
}
.steps-list > li:last-child { padding-bottom: 0; }
.steps-list h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.steps-list p { margin: 0 0 .5rem; color: var(--text-muted); }
.steps-list p:last-child { margin-bottom: 0; }

/* ---------- 10. Estadisticas --------------------------------------------- */

.stats {
    display: grid;
    gap: .9rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.stat {
    min-width: 0;
    padding: 1.3rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: center;
}
.stat__num {
    display: block;
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--gold);
}
.stat__label {
    display: block;
    margin-top: .3rem;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* ---------- 11. Linea de tiempo / hoja de ruta --------------------------- */

.timeline {
    position: relative;
    max-width: 760px;
    margin: 0;
    padding: 0 0 0 1.9rem;
    list-style: none;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: .55rem; bottom: .55rem;
    width: 2px;
    background: linear-gradient(180deg, var(--ice) 0%, var(--line-strong) 70%, transparent 100%);
}
.timeline > li { position: relative; padding-bottom: 1.6rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
    content: "";
    position: absolute;
    left: -1.9rem; top: .5rem;
    width: 16px; height: 16px;
    border: 2px solid var(--ice);
    border-radius: 50%;
    background: var(--bg);
}
.timeline > li.is-done::before { background: var(--green); border-color: var(--green); }
.timeline > li.is-future::before { border-color: var(--line-strong); }
.timeline h3 { margin: .15rem 0 .25rem; font-size: 1.02rem; }
.timeline p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.tag {
    display: inline-block;
    padding: .13rem .5rem;
    border-radius: 5px;
    background: var(--ice-wash);
    color: var(--ice);
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tag--done   { background: var(--green-wash); color: var(--green); }
.tag--soon   { background: var(--amber-wash); color: var(--amber); }
.tag--future { background: var(--ice-wash);   color: var(--text-faint); }

/* ---------- 12. Avisos, destacados, cita --------------------------------- */

.notice {
    margin: 1.4rem 0;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--amber-wash);
    color: var(--text);
    font-size: .92rem;
}
.notice strong { color: var(--amber); }
.notice--ice { border-left-color: var(--ice); background: var(--ice-wash); }
.notice--ice strong { color: var(--ice); }
.notice p { margin: 0; }
.notice p + p { margin-top: .6rem; }

.panel {
    padding: clamp(1.5rem, 4vw, 2.4rem);
    border: 1px solid var(--gold);
    border-radius: var(--radius);
    background: var(--gold-wash);
}
.panel h2, .panel h3 { margin-top: 0; }

.quote {
    margin: 2rem 0;
    padding-left: 1.4rem;
    border-left: 2px solid var(--gold);
    color: var(--text-muted);
    font-size: 1.05rem;
    font-style: italic;
}
.quote cite {
    display: block;
    margin-top: .6rem;
    color: var(--text-faint);
    font-size: .82rem;
    font-style: normal;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ---------- 13. Prosa (guia y lore) -------------------------------------- */

.prose { max-width: 72ch; min-width: 0; }
.prose > h2 {
    margin: 3rem 0 1rem;
    padding-top: .4rem;
    font-size: clamp(1.45rem, 3.5vw, 1.9rem);
}
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { margin: 2rem 0 .7rem; font-size: 1.14rem; }
.prose > h4 { margin: 1.5rem 0 .5rem; font-size: 1rem; color: var(--gold); }
.prose p { margin: 0 0 1rem; color: var(--text-muted); }
.prose p strong, .prose li strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.3rem; color: var(--text-muted); }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--ice); }
.prose > :last-child { margin-bottom: 0; }

/* seccion de documento con ancla */
.doc-section { scroll-margin-top: 96px; }

/* ---------- 14. Tablas --------------------------------------------------- */

.table-wrap {
    width: 100%;
    max-width: 100%;
    margin: 1.2rem 0 1.6rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: .9rem;
}
caption {
    padding: .8rem 1rem;
    color: var(--text-faint);
    font-size: .8rem;
    text-align: left;
}
th, td {
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
thead th {
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-display);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td { color: var(--text-muted); }
td:first-child { color: var(--text); font-weight: 500; }

/* ---------- 15. Indice lateral (guia / lore) ----------------------------- */

.with-toc {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}
/* Sin esto, el min-width:auto de los items de rejilla deja que la anchura
   minima de una tabla empuje la columna y desborde el viewport a 380px. */
.with-toc > * { min-width: 0; }
@media (min-width: 960px) {
    .with-toc { grid-template-columns: 230px minmax(0, 1fr); }
}
.toc {
    min-width: 0;
    padding: 1.2rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
@media (min-width: 960px) {
    .toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
}
.toc h2 {
    margin: 0 0 .8rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: hdn-toc; }
.toc li { counter-increment: hdn-toc; }
.toc a {
    display: block;
    padding: .34rem 0 .34rem 1.8rem;
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .88rem;
    line-height: 1.45;
    border-radius: 5px;
}
.toc a::before {
    content: counter(hdn-toc, decimal-leading-zero);
    position: absolute;
    left: 0;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: .72rem;
}
.toc a:hover { color: var(--ice); }

/* ---------- 16. Noticias ------------------------------------------------- */

.news-list { display: grid; gap: 1.1rem; }

.story {
    display: grid;
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: clamp(1.2rem, 3vw, 2.2rem);
    padding: clamp(1.4rem, 3.5vw, 2.3rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 96px;
}
.story:target {
    border-color: var(--ice);
    box-shadow: 0 0 0 1px var(--ice-wash), var(--shadow-md);
}
.story__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .7rem;
    min-width: 0;
}
.story__body { min-width: 0; }
.story__body h2 {
    margin: 0 0 .7rem;
    font-size: clamp(1.2rem, 2.8vw, 1.6rem);
}
.story__body > p { margin: 0 0 .9rem; color: var(--text-muted); }
.story__body > p:first-of-type { color: var(--text); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .3rem .65rem;
    border: 1px solid var(--green);
    border-radius: 999px;
    background: var(--green-wash);
    color: var(--green);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge--testing { border-color: var(--amber); background: var(--amber-wash); color: var(--amber); }

.date {
    color: var(--text-faint);
    font-size: .78rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: .4rem 1.6rem;
    margin: 1.3rem 0 0;
    padding: 1.2rem 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
}
.details li {
    position: relative;
    min-width: 0;
    padding-left: 1.05rem;
    color: var(--text-muted);
    font-size: .89rem;
}
.details li::before {
    content: "";
    position: absolute;
    left: 0; top: .72em;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--ice);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.4rem;
    margin-top: 1.6rem;
    color: var(--text-faint);
    font-size: .8rem;
}
.legend span { display: inline-flex; align-items: center; gap: .5rem; }
.legend i {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
}
.legend i.is-testing { background: var(--amber); }

@media (max-width: 700px) {
    .story { grid-template-columns: 1fr; gap: 1rem; }
    .story__meta { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- 17. Pie ------------------------------------------------------ */

.site-footer {
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-block: clamp(2.5rem, 5vw, 3.5rem);
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text-faint);
    font-size: .85rem;
}
.site-footer__grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.site-footer h2 {
    margin: 0 0 .8rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer__legal {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    line-height: 1.6;
    max-width: 70ch;
}

/* ---------- 18. Revelado al hacer scroll --------------------------------- */

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(14px);
        transition: opacity .6s ease-out, transform .6s ease-out;
    }
    .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- 19. Utilidades ----------------------------------------------- */

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
