/*
 * Inicio público de SICAT (vista home/index.php).
 * Solo se carga en «/» desde el layout. Todo vive bajo .hx para no tocar otras pantallas.
 * Paleta SICAT: verdes #16332a–#3a7260, acento dorado #c49a6c y fondos cálidos.
 */

.hx {
    --hx-ink: #12261f;
    --hx-ink-2: #3d5249;
    --hx-muted: #5a6c63;
    --hx-green-950: #0f241d;
    --hx-green-900: #16332a;
    --hx-green-800: #1f4338;
    --hx-green-700: #2d5a4b;
    --hx-green-600: #3a7260;
    --hx-green-100: #dfeae3;
    --hx-green-50: #f0f5f1;
    --hx-gold: #c49a6c;
    --hx-gold-300: #e6d194;
    --hx-gold-700: #7c5f30;
    --hx-paper: #fbfaf6;
    --hx-sand: #f6f1e7;
    --hx-line: rgba(18, 38, 31, .1);
    --hx-line-strong: rgba(18, 38, 31, .2);
    --hx-shadow: 0 1px 2px rgba(18, 38, 31, .05), 0 18px 40px -22px rgba(18, 38, 31, .35);
    --hx-ease: cubic-bezier(.2, .7, .2, 1);

    color: var(--hx-ink);
    background: var(--hx-paper);
    font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    overflow-x: clip;
}

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

/* Reinicio local. :where() lo deja con la especificidad de una sola clase:
   gana a Bootstrap y cede ante cualquier regla .hx-* que venga después. */
.hx :where(h1, h2, h3) {
    margin: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
    letter-spacing: -.02em;
}

.hx :where(p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }

.hx :where(ul, ol) { padding: 0; list-style: none; }

.hx :where(em) { font-style: normal; font-weight: 700; }

.hx-wrap {
    width: min(1200px, calc(100% - 2.5rem));
    margin-inline: auto;
}

.hx section[id] { scroll-margin-top: 5.5rem; }

@media (prefers-reduced-motion: no-preference) {
    html:has(.hx) { scroll-behavior: smooth; }
}

/* ---------- Tipografía y piezas comunes ---------- */

.hx-kicker {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font: 700 .72rem/1.3 'Montserrat', sans-serif;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--hx-green-700);
}

.hx-kicker::before {
    content: "";
    flex: none;
    width: 1.75rem;
    height: 2px;
    border-radius: 2px;
    background: var(--hx-gold);
}

.hx-h2 {
    margin-top: .9rem;
    font-size: clamp(1.7rem, 1.15rem + 2.3vw, 2.7rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--hx-green-900);
    text-wrap: balance;
}

.hx-lead {
    margin-top: 1rem;
    max-width: 62ch;
    font-size: clamp(1rem, .96rem + .28vw, 1.14rem);
    line-height: 1.65;
    color: var(--hx-ink-2);
    text-wrap: pretty;
}

.hx-lead em { color: var(--hx-green-800); }

.hx-sec { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.hx-sec--sand {
    background:
        radial-gradient(52rem 26rem at 100% 0%, rgba(196, 154, 108, .16), transparent 62%),
        var(--hx-sand);
}

.hx-head { max-width: 46rem; }

.hx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 3rem;
    padding: .8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 700 .94rem/1.1 'Montserrat', sans-serif;
    text-decoration: none;
    transition: transform .2s var(--hx-ease), box-shadow .2s var(--hx-ease), background-color .2s, border-color .2s, color .2s;
}

.hx-btn .bi { font-size: 1.05em; transition: transform .2s var(--hx-ease); }
.hx-btn:hover .bi-arrow-right { transform: translateX(3px); }

.hx-btn:focus-visible,
.hx a:focus-visible,
.hx button:focus-visible {
    outline: 3px solid var(--hx-gold);
    outline-offset: 3px;
}

.hx-btn--gold {
    color: #16261f;
    background: linear-gradient(180deg, #e7c797 0%, #c8a074 100%);
    box-shadow: 0 12px 28px -12px rgba(196, 154, 108, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.hx-btn--gold:hover {
    color: #16261f;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgba(196, 154, 108, .95), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.hx-btn--ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .06);
}

.hx-btn--ghost:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .14);
}

.hx-btn--line {
    color: var(--hx-green-800);
    border-color: var(--hx-line-strong);
    background: #fff;
}

.hx-btn--line:hover {
    color: #fff;
    border-color: var(--hx-green-800);
    background: var(--hx-green-800);
}

.hx-card__ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    font-size: 1.2rem;
    color: var(--hx-green-700);
    background: linear-gradient(160deg, #edf4ef, var(--hx-green-100));
}

.hx-tag {
    display: inline-flex;
    align-items: center;
    padding: .28rem .65rem;
    border-radius: 999px;
    font: 700 .68rem/1.2 'Montserrat', sans-serif;
    letter-spacing: .04em;
    color: var(--hx-gold-700);
    background: rgba(196, 154, 108, .16);
}

/* ---------- Encabezado ---------- */

.hx-hero {
    position: relative;
    isolation: isolate;
    padding: clamp(2.75rem, 6vw, 5.25rem) 0 clamp(7.5rem, 13vw, 10rem);
    color: #fff;
    background: var(--hx-green-900);
    overflow: clip;
}

.hx-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(58rem 34rem at 88% -12%, rgba(196, 154, 108, .3), transparent 60%),
        radial-gradient(46rem 32rem at -12% 112%, rgba(58, 114, 96, .6), transparent 62%),
        linear-gradient(160deg, var(--hx-green-950) 0%, var(--hx-green-900) 46%, var(--hx-green-800) 100%);
}

/* Trama de «granos»: puntos dorados que se desvanecen hacia abajo. */
.hx-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(230, 209, 148, .2) 1.2px, transparent 1.7px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
    pointer-events: none;
}

.hx-hero__grid {
    display: grid;
    gap: clamp(2.25rem, 5vw, 4rem);
    align-items: center;
}

.hx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    max-width: 100%;
    padding: .42rem .9rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    font: 600 .78rem/1.35 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, .9);
}

.hx-eyebrow i {
    flex: none;
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--hx-gold-300);
    box-shadow: 0 0 0 4px rgba(230, 209, 148, .2);
}

.hx-hero__title {
    margin-top: 1.3rem;
    font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.7rem);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.hx-hero__title em {
    font-weight: 800;
    color: var(--hx-gold-300);
}

.hx-hero__lead {
    margin-top: 1.3rem;
    max-width: 54ch;
    font-size: clamp(1rem, .95rem + .35vw, 1.18rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, .84);
    text-wrap: pretty;
}

.hx-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.9rem;
}

.hx-hero__points {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.6rem;
    margin-top: 2.2rem;
    font-size: .88rem;
    color: rgba(255, 255, 255, .8);
}

.hx-hero__points li {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.hx-hero__points .bi { color: var(--hx-gold-300); font-size: 1rem; }

.hx-hero__visual {
    position: relative;
    width: min(100%, 29rem);
    margin-inline: auto;
}

.hx-hero__visual::before {
    content: "";
    position: absolute;
    inset: 1.1rem -1.1rem -1.1rem 1.1rem;
    border: 1px solid rgba(230, 209, 148, .38);
    border-radius: 28px;
    pointer-events: none;
}

.hx-photo {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(160deg, var(--hx-green-700), var(--hx-green-950));
    box-shadow: 0 40px 80px -34px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .14);
}

.hx-photo__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .9s ease;
}

.hx-photo__img.is-active { opacity: 1; }

.hx-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 20, 16, 0) 52%, rgba(8, 20, 16, .78) 100%);
    pointer-events: none;
}

.hx-photo__cap {
    position: absolute;
    z-index: 2;
    inset: auto 1rem .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-size: .8rem;
    line-height: 1.3;
    color: #fff;
}

.hx-photo__cap > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hx-photo__dots { flex: none; display: inline-flex; }

.hx-photo__dots button {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hx-photo__dots button::before {
    content: "";
    width: .95rem;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .45);
    transition: background-color .2s, width .2s var(--hx-ease);
}

.hx-photo__dots button[aria-current="true"]::before {
    width: 1.3rem;
    background: var(--hx-gold-300);
}

.hx-photo--vacia {
    display: grid;
    place-items: center;
    font-size: 5rem;
    color: rgba(230, 209, 148, .5);
}

.hx-photo--vacia::after { display: none; }

.hx-chip {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .85rem .6rem .6rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6);
    font-size: .74rem;
    line-height: 1.3;
    color: var(--hx-muted);
    white-space: nowrap;
}

.hx-chip b {
    display: block;
    font: 700 .8rem/1.25 'Montserrat', sans-serif;
    color: var(--hx-green-900);
}

.hx-chip__ico {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 11px;
    font-size: 1rem;
    color: var(--hx-green-700);
    background: var(--hx-green-50);
}

.hx-chip__ico--ok { color: #fff; background: var(--hx-green-600); }

.hx-chip--a { top: .9rem; left: .9rem; }
.hx-chip--b { top: 42%; right: .9rem; }
.hx-chip--c { display: none; }

@media (prefers-reduced-motion: no-preference) {
    .hx-chip { animation: hx-flotar 7s ease-in-out infinite; }
    .hx-chip--b { animation-delay: -2.4s; }
    .hx-chip--c { animation-delay: -4.6s; }
}

@keyframes hx-flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* ---------- Cifras ---------- */

.hx-stats-wrap {
    position: relative;
    z-index: 2;
    margin-top: clamp(-6.25rem, -9vw, -5rem);
}

.hx-stats {
    padding: clamp(1.35rem, 3.2vw, 2.4rem);
    border: 1px solid var(--hx-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 34px 70px -44px rgba(18, 38, 31, .55);
}

.hx-stats__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.hx-stats__title {
    margin-top: .65rem;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
    font-weight: 800;
    color: var(--hx-green-900);
}

.hx-seg,
.hx-tabs {
    display: inline-flex;
    gap: .25rem;
    max-width: 100%;
    padding: .3rem;
    border: 1px solid var(--hx-line);
    border-radius: 999px;
    background: var(--hx-green-50);
}

.hx-seg button,
.hx-tabs button {
    flex: none;
    min-height: 2.6rem;
    padding: .55rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font: 700 .86rem/1.1 'Montserrat', sans-serif;
    color: var(--hx-ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s, color .2s, box-shadow .2s;
}

.hx-seg button:hover,
.hx-tabs button:hover { color: var(--hx-green-900); background: rgba(45, 90, 75, .09); }

.hx-seg button[aria-selected="true"],
.hx-tabs button[aria-selected="true"] {
    color: #fff;
    background: var(--hx-green-800);
    box-shadow: 0 8px 18px -10px rgba(18, 38, 31, .7);
}

.hx-stats__panel[hidden],
.hx-panel[hidden] { display: none; }

.hx-stats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem 1.25rem;
    margin-top: 1.9rem;
}

.hx-stat {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    min-width: 0;
}

.hx-stat dd {
    font: 800 clamp(1.7rem, 1.05rem + 2.9vw, 3rem)/1 'Montserrat', sans-serif;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    color: var(--hx-green-900);
}

.hx-stat dd small {
    margin-left: .3rem;
    font-size: .42em;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--hx-gold-700);
}

.hx-stat dt {
    margin-top: .55rem;
    font-size: .88rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--hx-muted);
}

.hx-stats__note {
    margin-top: 1.4rem;
    font-size: .9rem;
    color: var(--hx-ink-2);
}

.hx-stats__src,
.hx-explorer__src {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--hx-line-strong);
    font-size: .8rem;
    line-height: 1.5;
    color: var(--hx-muted);
}

.hx-stats__src a,
.hx-explorer__src a {
    font-weight: 700;
    color: var(--hx-green-700);
    text-decoration: underline;
    text-decoration-color: rgba(45, 90, 75, .35);
    text-underline-offset: 3px;
    white-space: nowrap;
}

.hx-stats__src a:hover,
.hx-explorer__src a:hover { color: var(--hx-green-900); text-decoration-color: currentColor; }

.hx-quote {
    max-width: 52rem;
    margin: clamp(2.5rem, 6vw, 4rem) auto 0;
    text-align: center;
}

.hx-quote blockquote {
    font: 600 clamp(1.15rem, 1rem + 1vw, 1.6rem)/1.45 'Montserrat', sans-serif;
    letter-spacing: -.015em;
    color: var(--hx-green-900);
    text-wrap: balance;
}

.hx-quote figcaption {
    margin-top: .9rem;
    font-size: .86rem;
    color: var(--hx-muted);
}

.hx-quote figcaption::before {
    content: "";
    display: block;
    width: 2rem;
    height: 2px;
    margin: 0 auto .8rem;
    border-radius: 2px;
    background: var(--hx-gold);
}

/* ---------- Plataforma (bento) ---------- */

.hx-bento {
    display: grid;
    gap: 1rem;
    margin-top: clamp(2rem, 4vw, 3rem);
}

.hx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    min-width: 0;
    padding: 1.5rem;
    border: 1px solid var(--hx-line);
    border-radius: 22px;
    background: #fff;
    transition: transform .25s var(--hx-ease), box-shadow .25s var(--hx-ease), border-color .25s;
}

.hx-card:hover {
    transform: translateY(-3px);
    border-color: rgba(45, 90, 75, .3);
    box-shadow: var(--hx-shadow);
}

.hx-card h3 {
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--hx-green-900);
}

.hx-card p {
    font-size: .93rem;
    line-height: 1.6;
    color: var(--hx-ink-2);
}

.hx-card--feature {
    gap: 1.25rem;
    color: #fff;
    border-color: transparent;
    background:
        radial-gradient(26rem 16rem at 100% 0%, rgba(196, 154, 108, .28), transparent 62%),
        linear-gradient(160deg, var(--hx-green-800), var(--hx-green-950));
}

.hx-card--feature:hover { border-color: transparent; }

.hx-card--feature .hx-card__body { display: flex; flex-direction: column; gap: .8rem; }
.hx-card--feature h3 { font-size: 1.3rem; color: #fff; }
.hx-card--feature p { color: rgba(255, 255, 255, .82); }

.hx-card--feature .hx-card__ico {
    color: var(--hx-gold-300);
    background: rgba(255, 255, 255, .1);
}

.hx-mini {
    display: grid;
    gap: .45rem;
    padding: .9rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px;
    background: rgba(255, 255, 255, .07);
}

.hx-mini li {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    padding: .5rem .7rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, .08);
    font-size: .84rem;
    color: rgba(255, 255, 255, .92);
}

.hx-mini li > .bi { flex: none; color: var(--hx-gold-300); }
.hx-mini li > span { flex: 1; min-width: 0; }

.hx-mini li > em {
    flex: none;
    font: 600 .72rem/1.2 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, .7);
}

.hx-mini__id > em {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    letter-spacing: .02em;
    color: var(--hx-gold-300) !important;
}

.hx-roles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
    margin-top: 1.75rem;
}

.hx-roles__label {
    font: 700 .78rem/1.3 'Montserrat', sans-serif;
    letter-spacing: .04em;
    color: var(--hx-muted);
}

.hx-roles ul { display: flex; flex-wrap: wrap; gap: .5rem; }

.hx-roles li {
    padding: .42rem .85rem;
    border: 1px solid var(--hx-line-strong);
    border-radius: 999px;
    background: #fff;
    font-size: .84rem;
    font-weight: 600;
    color: var(--hx-green-800);
}

/* ---------- Componente (explorador con pestañas) ---------- */

.hx-explorer { margin-top: clamp(2rem, 4vw, 2.75rem); }

.hx-tabs {
    overflow-x: auto;
    background: #fff;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.hx-tabs::-webkit-scrollbar { display: none; }

.hx-panel { margin-top: 1.5rem; }
.hx-panel:focus-visible { outline: 3px solid var(--hx-gold); outline-offset: 6px; border-radius: 12px; }

.hx-panel__intro {
    max-width: 60ch;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--hx-ink-2);
}

.hx-panel__hint {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.1rem;
    font-size: .84rem;
    color: var(--hx-muted);
}

.hx-panel__hint .bi { color: var(--hx-green-700); }

.hx-steps,
.hx-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
}

.hx-steps { counter-reset: hx-paso; }

.hx-step,
.hx-apoyo,
.hx-figura,
.hx-principio {
    min-width: 0;
    padding: 1.35rem;
    border: 1px solid var(--hx-line);
    border-radius: 20px;
    background: #fff;
}

.hx-step { counter-increment: hx-paso; }

.hx-step::before {
    content: counter(hx-paso, decimal-leading-zero);
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .9rem;
    font: 800 .82rem/1 'Montserrat', sans-serif;
    letter-spacing: .1em;
    color: var(--hx-gold-700);
}

.hx-step h3,
.hx-apoyo h3,
.hx-principio h3,
.hx-figura dt {
    font: 700 1.02rem/1.3 'Montserrat', sans-serif;
    letter-spacing: -.01em;
    color: var(--hx-green-900);
}

.hx-step p,
.hx-apoyo p,
.hx-principio p,
.hx-figura dd {
    margin-top: .5rem;
    font-size: .92rem;
    line-height: 1.58;
    color: var(--hx-ink-2);
}

.hx-step__sicat {
    display: inline-flex;
    align-items: flex-start;
    gap: .45rem;
    margin-top: .9rem;
    padding: .38rem .7rem;
    border-radius: 12px;
    background: var(--hx-green-50);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--hx-green-700);
}

.hx-step__sicat .bi { flex: none; margin-top: .1rem; }

.hx-apoyo { display: flex; flex-direction: column; }

.hx-apoyo__top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .9rem;
    margin-bottom: .45rem;
}

/* En los apoyos el grupo va como antetítulo (cabe en tarjetas angostas). */
.hx-apoyo .hx-tag {
    padding: 0;
    background: none;
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hx-apoyo .hx-apoyo__dato {
    margin-top: auto;
    padding-top: .9rem;
    font-size: .84rem;
    font-weight: 700;
    color: var(--hx-green-800);
}

.hx-apoyo__dato::before {
    content: "";
    display: block;
    height: 1px;
    margin-bottom: .8rem;
    background: var(--hx-line);
}

.hx-principio {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
}

.hx-principio > .bi {
    flex: none;
    margin-top: .1rem;
    font-size: 1.3rem;
    color: var(--hx-green-600);
}

.hx-principio.is-sicat {
    border-color: rgba(45, 90, 75, .45);
    box-shadow: inset 0 0 0 1px rgba(45, 90, 75, .45);
}

/* ---------- Coordinación ---------- */

.hx-coord {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.hx-coord__lema {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.4rem 0 1.6rem;
    font: 600 .92rem/1.3 'Montserrat', sans-serif;
    color: var(--hx-green-800);
}

.hx-coord__lema i {
    flex: none;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--hx-gold);
}

.hx-directorio {
    padding: clamp(1.35rem, 3vw, 2rem);
    border: 1px solid var(--hx-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--hx-shadow);
}

.hx-directorio h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hx-green-900);
}

.hx-directorio ul { display: grid; margin-top: .6rem; }

.hx-directorio li {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--hx-line);
}

.hx-directorio li:first-child { border-top: 0; }
.hx-directorio li > div { min-width: 0; }

.hx-directorio b {
    display: block;
    font: 700 .76rem/1.3 'Montserrat', sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hx-muted);
}

.hx-directorio li span:not(.hx-card__ico),
.hx-directorio li a {
    display: block;
    margin-top: .2rem;
    font-size: .98rem;
    line-height: 1.4;
    color: var(--hx-ink);
    overflow-wrap: break-word;
}

.hx-directorio li a {
    text-decoration: underline;
    text-decoration-color: rgba(45, 90, 75, .35);
    text-underline-offset: 3px;
}

.hx-directorio li a:hover { color: var(--hx-green-700); }

/* ---------- Cierre ---------- */

.hx-final { padding: 0 0 clamp(3rem, 7vw, 5rem); }

.hx-final__card {
    display: grid;
    gap: 1.5rem 2.5rem;
    align-items: center;
    padding: clamp(1.75rem, 4.5vw, 3.25rem);
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(34rem 20rem at 100% 0%, rgba(196, 154, 108, .32), transparent 62%),
        linear-gradient(150deg, var(--hx-green-800), var(--hx-green-950));
}

.hx-final__card h2 {
    font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.15rem);
    line-height: 1.15;
    font-weight: 800;
    text-wrap: balance;
}

.hx-final__card p {
    margin-top: .7rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, .82);
}

.hx-final__cta { display: flex; flex-wrap: wrap; gap: .7rem; }

.hx-leyenda {
    max-width: 60rem;
    margin: 1.5rem auto 0;
    font-size: .8rem;
    line-height: 1.5;
    text-align: center;
    color: var(--hx-muted);
}

/* ---------- Aparición al hacer scroll (solo con JS y sin «reducir movimiento») ---------- */

@media (prefers-reduced-motion: no-preference) {
    html.hx-js .hx-reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity .6s var(--hx-ease), transform .6s var(--hx-ease);
        transition-delay: var(--hx-delay, 0s);
    }

    html.hx-js .hx-reveal.is-in {
        opacity: 1;
        transform: none;
    }
}

/* Al imprimir no hay scroll: todo el contenido debe verse. */
@media print {
    html.hx-js .hx-reveal { opacity: 1; transform: none; }
    .hx-stats__panel[hidden],
    .hx-panel[hidden] { display: block; }
}

/* ---------- Tableta ---------- */

@media (min-width: 640px) {
    .hx-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hx-card--feature { grid-column: 1 / -1; }
    .hx-steps,
    .hx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hx-photo { aspect-ratio: 4 / 3; }
}

@media (min-width: 768px) {
    .hx-wrap { width: min(1200px, calc(100% - 4rem)); }
    .hx-stats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
    .hx-stat { padding: 0 1.4rem; border-left: 1px solid var(--hx-line); }
    .hx-stat:first-child { padding-left: 0; border-left: 0; }
    .hx-card--feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 2rem; padding: 2rem; }
    .hx-final__card { grid-template-columns: minmax(0, 1.15fr) auto; }
    .hx-final__cta { justify-content: flex-end; max-width: 26rem; }
}

/* Tableta: el quinto módulo ocupa el renglón completo para no quedar suelto. */
@media (min-width: 640px) and (max-width: 991.98px) {
    .hx-bento .hx-card:last-child { grid-column: 1 / -1; }
}

/* ---------- Escritorio ---------- */

@media (min-width: 992px) {
    .hx-hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .hx-hero__visual { margin-inline: auto 1.1rem; }
    .hx-photo { aspect-ratio: 4 / 5; }
    .hx-chip--a { top: 2.4rem; left: -3.4rem; }
    .hx-chip--b { top: 46%; right: -2.2rem; }
    .hx-chip--c { display: flex; bottom: 4.2rem; left: -2.4rem; }

    .hx-bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .hx-bento .hx-card { grid-column: span 2; }
    .hx-bento .hx-card--feature { grid-column: span 4; grid-row: span 2; display: flex; align-items: stretch; justify-content: space-between; padding: 2rem; }
    .hx-bento .hx-card--feature .hx-card__body { max-width: 36rem; }
    .hx-bento .hx-card--feature h3 { font-size: 1.55rem; }
    .hx-bento .hx-card--feature p { font-size: 1.02rem; }
    .hx-bento .hx-mini li { padding: .7rem .85rem; }
    .hx-bento .hx-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Encabezado de sección: título a la izquierda y texto a la derecha. */
    .hx-head { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); column-gap: clamp(2.5rem, 5vw, 5rem); align-items: end; max-width: none; }
    .hx-head .hx-lead { margin-top: 0; }

    .hx-steps,
    .hx-grid--figuras { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hx-grid--principios { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    /* Apoyos: 3 productivos arriba y 4 abajo (acompañamiento y cadena producción-consumo). */
    .hx-grid--apoyos { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .hx-grid--apoyos .hx-apoyo { grid-column: span 3; }
    .hx-grid--apoyos .hx-apoyo:nth-child(-n+3) { grid-column: span 4; }

    .hx-coord { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
}

/* ---------- Teléfono ---------- */

@media (max-width: 639.98px) {
    /* Módulos: icono a la izquierda y texto a la derecha (menos alto que apilado). */
    .hx-bento .hx-card:not(.hx-card--feature) {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: .3rem .9rem;
        padding: 1.1rem;
    }
    .hx-bento .hx-card:not(.hx-card--feature) .hx-card__ico { grid-row: span 2; }

    /* Etapas: línea de tiempo vertical en vez de seis tarjetas. */
    .hx-steps { gap: 0; }
    .hx-step {
        position: relative;
        padding: 0 0 1.6rem 3.1rem;
        border: 0;
        border-radius: 0;
        background: none;
    }
    .hx-step:last-child { padding-bottom: 0; }
    .hx-step::before {
        position: absolute;
        top: 0;
        left: 0;
        display: grid;
        place-items: center;
        width: 2.2rem;
        height: 2.2rem;
        margin: 0;
        border: 1px solid var(--hx-line-strong);
        border-radius: 50%;
        background: #fff;
        font-size: .74rem;
        letter-spacing: 0;
    }
    .hx-step::after {
        content: "";
        position: absolute;
        top: 2.45rem;
        bottom: .25rem;
        left: 1.1rem;
        width: 1px;
        background: var(--hx-line-strong);
    }
    .hx-step:last-child::after { display: none; }
    .hx-step h3 { padding-top: .35rem; }

    .hx-hero__visual::before { inset: .7rem -.55rem -.7rem .7rem; }
}

@media (max-width: 575.98px) {
    .hx-hero__cta .hx-btn { flex: 1 1 100%; }
    .hx-final__cta .hx-btn { flex: 1 1 100%; }
    .hx-seg { width: 100%; }
    .hx-seg button { flex: 1 1 0; }
    .hx-chip { padding: .5rem .7rem .5rem .5rem; font-size: .7rem; }
    .hx-chip b { font-size: .74rem; }
    .hx-chip__ico { width: 1.85rem; height: 1.85rem; font-size: .9rem; }
    .hx-chip--b { top: auto; bottom: 3.4rem; }
    .hx-mini li > em { display: none; }
    .hx-mini__id > em { display: inline !important; font-size: .68rem !important; }
    .hx-stats__src a,
    .hx-explorer__src a { white-space: normal; }
}
