/* ============================================================
   dalo-ui.css — Botones, cards de proyecto y bloques del home
   Extiende el lenguaje del sitio: mayúsculas condensadas, índices,
   flechas, neón sobre #0B101A y detalles HUD/terminal.
   CSS propio (no clases nuevas de Tailwind → no hay que recompilar
   tailwind.css). Los acentos salen de --color-primary (o de --svc
   para la identidad de cada servicio), así que obedecen al selector
   de color de theme.js: color custom, efecto especial y restaurar.
   ============================================================ */

/* ── Botones ────────────────────────────────────────────────
   [ ETIQUETA | → ]  La flecha vive en su propia celda, como un
   prompt de terminal. Esquinas HUD que se alargan y un barrido
   de luz al pasar el mouse. --c = color del acento. */
.dbtn {
    --c: var(--color-primary, 6 249 148);
    --tick: rgb(var(--c));
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    min-height: 3.25rem;
    padding: 0 1.4rem;
    border: 1px solid rgb(var(--c) / 0.34);
    border-radius: 2px;
    background: rgb(var(--c) / 0.04);
    color: inherit;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    isolation: isolate;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease,
        box-shadow 0.45s ease, scale 0.15s ease;
}

/* Barrido de luz (scanline) */
.dbtn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, transparent 30%, rgb(var(--c) / 0.22) 50%, transparent 70%);
    transform: translateX(-101%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* Esquinas HUD: arriba-izquierda y abajo-derecha */
.dbtn::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(var(--tick) 0 0) left top / 10px 1.5px no-repeat,
        linear-gradient(var(--tick) 0 0) left top / 1.5px 10px no-repeat,
        linear-gradient(var(--tick) 0 0) right bottom / 10px 1.5px no-repeat,
        linear-gradient(var(--tick) 0 0) right bottom / 1.5px 10px no-repeat;
    transition: background-size 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dbtn:hover {
    border-color: rgb(var(--c) / 0.75);
    background-color: rgb(var(--c) / 0.1);
    box-shadow: 0 0 28px -6px rgb(var(--c) / 0.55);
}

html.dark .dbtn:hover {
    color: rgb(var(--c));
}

.dbtn:hover::before {
    transform: translateX(101%);
}

.dbtn:hover::after {
    background-size: 22px 1.5px, 1.5px 22px, 22px 1.5px, 1.5px 22px;
}

.dbtn:active {
    scale: 0.97;
}

.dbtn:focus-visible {
    outline: 2px solid rgb(var(--c));
    outline-offset: 3px;
}

.dbtn__icon {
    display: grid;
    place-items: center;
    align-self: stretch;
    margin-right: -0.5rem;
    padding-left: 0.85rem;
    border-left: 1px solid rgb(var(--c) / 0.3);
    font-size: 19px !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.dbtn:hover .dbtn__icon {
    transform: translateX(3px);
}

.dbtn:hover .dbtn__icon--diag {
    transform: translate(2px, -2px);
}

/* Ícono al frente (sin celda), para acciones secundarias */
.dbtn__lead {
    margin-left: -0.2rem;
    font-size: 17px !important;
}

/* Índice mono (01, 02…) al frente de la etiqueta */
.dbtn__idx {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    opacity: 0.6;
}

/* Relleno neón: la acción principal de cada bloque */
.dbtn--primary {
    --tick: rgb(11 16 26 / 0.55);
    border-color: rgb(var(--c));
    background: rgb(var(--c));
    color: #0B101A !important;
    box-shadow: 0 14px 34px -16px rgb(var(--c) / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.28);
}

.dbtn--primary::before {
    background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.5) 50%, transparent 70%);
}

.dbtn--primary:hover {
    background: rgb(var(--c));
    color: #0B101A !important;
    box-shadow: 0 0 0 1px rgb(var(--c)), 0 0 38px -2px rgb(var(--c) / 0.6);
}

html.dark .dbtn--primary:hover {
    color: #0B101A;
}

.dbtn--primary .dbtn__icon {
    border-left-color: rgb(11 16 26 / 0.22);
}

/* Identidad de servicio: el acento es el --svc de la sección */
.dbtn--svc {
    --c: var(--svc);
    color: rgb(var(--svc));
}

html:not(.dark) .dbtn--svc {
    color: #0f172a;
}

/* WhatsApp */
.dbtn--wa {
    --c: 34 197 94;
}

.dbtn--sm {
    min-height: 2.4rem;
    padding: 0 1rem;
    gap: 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
}

.dbtn--sm .dbtn__icon {
    font-size: 16px !important;
    margin-right: -0.35rem;
    padding-left: 0.6rem;
}

.dbtn--lg {
    min-height: 3.75rem;
    padding: 0 1.9rem;
    font-size: 0.8rem;
}

.dbtn--block {
    width: 100%;
}

/* Solo escritorio (equivale a "hidden md:flex", que aquí no sirve porque
   .dbtn declara su propio display) */
.dbtn--desk {
    display: none;
}

@media (min-width: 768px) {
    .dbtn--desk {
        display: inline-flex;
    }
}

.dbtn[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* Botones o piezas que los scripts ocultan con la clase .hidden de Tailwind
   (p.ej. el ícono del botón de envío mientras carga, o "Dejar un review") */
.dbtn.hidden,
.dbtn .hidden {
    display: none !important;
}

/* Botón cuadrado de ícono (búsqueda, menú móvil) */
.dbtn-icon {
    --c: var(--color-primary, 6 249 148);
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border: 1px solid rgb(100 116 139 / 0.3);
    border-radius: 2px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.4s ease;
}

html.dark .dbtn-icon {
    color: #8391a7;
}

.dbtn-icon:hover,
.dbtn-icon[aria-expanded="true"] {
    color: rgb(var(--c));
    border-color: rgb(var(--c) / 0.6);
    background: rgb(var(--c) / 0.06);
    box-shadow: 0 0 20px -6px rgb(var(--c) / 0.6);
}

.dbtn-icon:focus-visible {
    outline: 2px solid rgb(var(--c));
    outline-offset: 3px;
}

.dbtn-icon .material-symbols-outlined {
    font-size: 20px;
}

/* Hamburguesa: solo en móvil (va aquí y no con md:hidden porque
   .dbtn-icon declara su propio display) */
@media (min-width: 768px) {
    .nav-burger {
        display: none;
    }
}

/* ── Menú móvil ── */
.mnav {
    position: fixed;
    top: 5rem;
    left: 0;
    right: 0;
    z-index: 49;
    display: grid;
    padding: 0.5rem 1.5rem 1.5rem;
    background: rgb(11 16 26 / 0.97);
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);
}

html:not(.dark) .mnav {
    background: rgb(248 250 252 / 0.98);
    border-bottom-color: rgb(15 23 42 / 0.08);
}

.mnav[hidden] {
    display: none;
}

.mnav a:not(.dbtn) {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid rgb(100 116 139 / 0.14);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
}

.mnav a:not(.dbtn):hover {
    color: rgb(var(--color-primary));
}

.mnav__idx {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: rgb(var(--color-primary));
}

.mnav .dbtn {
    margin-top: 1.25rem;
}

@media (min-width: 768px) {
    .mnav {
        display: none !important;
    }
}

/* ── Núcleo IA: el bloque que abre el home ─────────────────── */
.ai-core {
    position: relative;
    padding: clamp(4.5rem, 11vh, 7.5rem) 1.5rem clamp(3.5rem, 9vh, 6rem);
    overflow: hidden;
}

/* Rejilla HUD de fondo (generada con CSS) */
.ai-core::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgb(var(--color-primary) / 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgb(var(--color-primary) / 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 75% 65% at 50% 35%, #000 15%, transparent 75%);
}

.ai-core__inner {
    position: relative;
    z-index: 3;
    max-width: 80rem;
    margin: 0 auto;
}

.ai-core__head {
    display: grid;
    gap: 1.1rem;
    max-width: 56rem;
    margin-bottom: clamp(2.25rem, 5vh, 3.25rem);
}

.ai-core__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgb(var(--color-primary));
}

.ai-core__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--color-primary));
    box-shadow: 0 0 10px rgb(var(--color-primary));
    animation: ai-pulse 1.8s ease-in-out infinite;
}

.ai-core__title {
    font-size: clamp(2.1rem, 5.6vw, 4.6rem);
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    text-wrap: balance;
}

.ai-core__title em {
    font-style: normal;
    color: rgb(var(--color-primary));
    text-shadow: 0 0 26px rgb(var(--color-primary) / 0.35);
}

html:not(.dark) .ai-core__title em {
    color: #0f172a;
    text-shadow: none;
    background: linear-gradient(transparent 62%, rgb(var(--color-primary) / 0.55) 62%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.ai-core__lead {
    max-width: 46ch;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    font-weight: 300;
    line-height: 1.65;
    color: #334155;
}

html.dark .ai-core__lead {
    color: #b6c2d4;
}

.ai-core__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 1099px) {
    .ai-core__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .ai-core__grid {
        grid-template-columns: 1fr;
    }
}

.ai-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    height: 100%;
    min-height: 17.5rem;
    padding: 1.35rem 1.35rem 1.2rem;
    border: 1px solid rgb(var(--svc) / 0.22);
    border-radius: 6px;
    background: linear-gradient(180deg, rgb(var(--svc) / 0.1), rgb(var(--svc) / 0.02) 65%);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.4s ease, box-shadow 0.5s ease;
}

html:not(.dark) .ai-card {
    background: linear-gradient(180deg, rgb(var(--svc) / 0.1), rgb(255 255 255 / 0.85) 70%);
}

.ai-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(90% 70% at 100% 0%, rgb(var(--svc) / 0.24), transparent 62%);
    opacity: 0.55;
    transition: opacity 0.5s ease;
}

/* Barra de "proceso en curso" que recorre el borde superior */
.ai-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgb(var(--svc)), transparent);
    transform: translateX(-110%);
    animation: ai-bar 3.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
    animation-delay: calc(var(--i, 0) * 0.45s);
}

.ai-card:hover,
.ai-card:focus-visible {
    border-color: rgb(var(--svc) / 0.65);
    box-shadow: 0 30px 60px -32px rgb(var(--svc) / 0.75);
}

.ai-card:focus-visible {
    outline: 2px solid rgb(var(--svc));
    outline-offset: 3px;
}

.ai-card:hover::before {
    opacity: 1;
}

.ai-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-card__idx {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: rgb(var(--svc));
}

.ai-card__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 4px;
    border: 1px solid rgb(var(--svc) / 0.3);
    background: rgb(var(--svc) / 0.12);
    color: rgb(var(--svc));
    font-size: 26px !important;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}

.ai-card:hover .ai-card__icon {
    transform: rotate(-6deg) scale(1.06);
    box-shadow: 0 0 26px rgb(var(--svc) / 0.45);
}

.ai-card__title {
    margin-top: 0.4rem;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.ai-card__desc {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #475569;
}

html.dark .ai-card__desc {
    color: #a3b1c6;
}

.ai-card__go {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid rgb(var(--svc) / 0.2);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgb(var(--svc));
}

html:not(.dark) .ai-card__go {
    color: #0f172a;
}

.ai-card__go .material-symbols-outlined {
    font-size: 18px;
    color: rgb(var(--svc));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-card:hover .ai-card__go .material-symbols-outlined {
    transform: translate(3px, -3px);
}

/* Línea de terminal que "despliega" soluciones (la escribe main.js) */
.ai-core__term {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    margin-top: 1.75rem;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #64748b;
}

html.dark .ai-core__term {
    color: #8391a7;
}

.ai-core__term b {
    color: rgb(var(--color-primary));
    font-weight: 700;
}

.ai-core__ok {
    color: rgb(var(--color-primary));
}

.ai-core__caret {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    background: rgb(var(--color-primary));
    vertical-align: -0.2em;
    animation: ai-caret 1s steps(1) infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes ai-bar {
    0% { transform: translateX(-110%); }
    60%, 100% { transform: translateX(190%); }
}

@keyframes ai-caret {
    50% { opacity: 0; }
}

/* ── Empresas: servicio corporativo ──────────────────────────
   Todo el bloque apunta a una idea: automatizar e integrar la
   operación del cliente. El acento es --color-primary (theme.js):
   color custom, efecto especial y restaurar lo mueven solo. */
.ent {
    --c: var(--color-primary, 6 249 148);
    position: relative;
    padding: clamp(3rem, 8vh, 5rem) 1.5rem clamp(4rem, 10vh, 6.5rem);
}

.ent__inner {
    max-width: 80rem;
    margin: 0 auto;
}

/* Cada pieza resuelve su propio acento: así el "efecto especial" de
   theme.js (que fija --color-primary por elemento) las pinta por separado */
.ent__kicker,
.ent__title em,
.ent__rail,
.ent-step {
    --c: var(--color-primary, 6 249 148);
}

.ent__head {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: end;
    gap: 1.25rem 3rem;
    margin-bottom: clamp(2.25rem, 5vh, 3rem);
}

.ent__kicker {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgb(var(--c));
}

.ent__dot {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    background: rgb(var(--c));
    box-shadow: 0 0 10px rgb(var(--c));
    animation: ai-pulse 1.8s ease-in-out infinite;
}

/* Más chico que el título del Núcleo IA: la IA sigue siendo lo primero */
.ent__title {
    font-size: clamp(1.9rem, 4.2vw, 3.4rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    text-wrap: balance;
}

.ent__title em {
    font-style: normal;
    color: rgb(var(--c));
}

.ent__lead {
    max-width: 48ch;
    font-size: clamp(0.98rem, 1.3vw, 1.08rem);
    font-weight: 300;
    line-height: 1.65;
    color: #334155;
}

html.dark .ent__lead {
    color: #b6c2d4;
}

@media (max-width: 899px) {
    .ent__head {
        grid-template-columns: 1fr;
    }
}

/* Pipeline 01→04: los pasos van unidos por un riel (el pulso lo recorre) */
.ent__pipe {
    position: relative;
}

.ent__steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ent__rail {
    position: absolute;
    top: 1.55rem;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, rgb(var(--c) / 0.7), rgb(var(--c) / 0.15));
    pointer-events: none;
}

.ent__rail::after {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgb(var(--c));
    box-shadow: 0 0 12px rgb(var(--c));
    animation: ent-pulse 4.5s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.ent-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0 0.25rem;
}

.ent-step__top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ent-step__idx {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    border: 1px solid rgb(var(--c) / 0.55);
    border-radius: 2px;
    background: #0B101A;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgb(var(--c));
}

html:not(.dark) .ent-step__idx {
    background: #f8fafc;
}

html:not(.dark) .ent-step__icon {
    background: linear-gradient(rgb(var(--c) / 0.12), rgb(var(--c) / 0.12)), #f8fafc;
}

.ent-step__icon {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 2px;
    /* opaco: el riel del pipeline pasa por detrás */
    background: linear-gradient(rgb(var(--c) / 0.12), rgb(var(--c) / 0.12)), #0B101A;
    color: rgb(var(--c));
    font-size: 21px !important;
}

.ent-step__title {
    margin-top: 0.35rem;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.ent-step__desc {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #475569;
}

html.dark .ent-step__desc {
    color: #a3b1c6;
}

.ent-step__tag {
    margin-top: auto;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.72rem;
    color: #64748b;
}

html.dark .ent-step__tag {
    color: #8391a7;
}

.ent-step__tag b {
    color: rgb(var(--c));
    font-weight: 700;
}

@media (max-width: 1023px) {
    .ent__steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.25rem;
    }

    .ent__rail {
        display: none;
    }
}

@media (max-width: 599px) {
    .ent__steps {
        grid-template-columns: 1fr;
    }
}

/* El botón gigante: todo el bloque es el enlace */
.ent-cta {
    --c: var(--color-primary, 6 249 148);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: clamp(9.5rem, 24vh, 13rem);
    margin-top: clamp(2.75rem, 7vh, 4.25rem);
    border: 1px solid rgb(var(--c) / 0.6);
    border-radius: 4px;
    background:
        linear-gradient(115deg, rgb(var(--c) / 0.13), rgb(var(--c) / 0.02) 58%),
        #0d1422;
    color: #f1f5f9;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 34px 80px -44px rgb(var(--c) / 0.75);
    transition: color 0.35s ease, border-color 0.4s ease, box-shadow 0.5s ease, scale 0.15s ease;
}

html:not(.dark) .ent-cta {
    background: linear-gradient(115deg, rgb(var(--c) / 0.16), #ffffff 62%);
    color: #0f172a;
}

/* Relleno de acento que barre de izquierda a derecha (solo transform: es
   una capa decorativa detrás del texto, nunca oculta contenido) */
.ent-cta__fill {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(var(--c));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Esquinas HUD grandes + rejilla tenue */
.ent-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgb(var(--c) / 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgb(var(--c) / 0.07) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
    mask-image: linear-gradient(90deg, #000, transparent 70%);
}

.ent-cta::after {
    content: "";
    position: absolute;
    inset: 10px;
    pointer-events: none;
    background:
        linear-gradient(rgb(var(--c)) 0 0) left top / 26px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left top / 2px 26px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left bottom / 26px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left bottom / 2px 26px no-repeat;
    transition: background-size 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ent-cta__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.5rem, 4vw, 3.25rem);
    min-width: 0;
}

.ent-cta__kicker {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.78rem;
    color: rgb(var(--c));
    transition: color 0.35s ease;
}

.ent-cta__label {
    font-size: clamp(1.9rem, 4.8vw, 4rem);
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    text-wrap: balance;
}

.ent-cta__sub {
    max-width: 52ch;
    font-size: clamp(0.92rem, 1.2vw, 1.02rem);
    font-weight: 400;
    line-height: 1.5;
    color: #b6c2d4;
    transition: color 0.35s ease;
}

html:not(.dark) .ent-cta__sub {
    color: #334155;
}

.ent-cta__arrow {
    display: grid;
    place-items: center;
    width: clamp(5.5rem, 12vw, 10rem);
    border-left: 1px solid rgb(11 16 26 / 0.25);
    background: rgb(var(--c));
    color: #0B101A;
    font-size: clamp(2.6rem, 5vw, 4.2rem) !important;
    transition: background-color 0.35s ease;
}

.ent-cta:hover,
.ent-cta:focus-visible {
    color: #0B101A;
    border-color: rgb(var(--c));
    box-shadow: 0 0 0 1px rgb(var(--c)), 0 30px 90px -30px rgb(var(--c) / 0.85);
}

.ent-cta:hover .ent-cta__fill,
.ent-cta:focus-visible .ent-cta__fill {
    transform: scaleX(1);
}

.ent-cta:hover .ent-cta__kicker,
.ent-cta:hover .ent-cta__sub,
.ent-cta:focus-visible .ent-cta__kicker,
.ent-cta:focus-visible .ent-cta__sub {
    color: #0B101A;
}

.ent-cta:hover::after,
.ent-cta:focus-visible::after {
    background-size: 60px 2px, 2px 60px, 60px 2px, 2px 60px;
    --c: 11 16 26;
}

.ent-cta:hover .ent-cta__arrow,
.ent-cta:focus-visible .ent-cta__arrow {
    background: rgb(11 16 26 / 0.12);
}

.ent-cta:active {
    scale: 0.99;
}

.ent-cta:focus-visible {
    outline: 2px solid rgb(var(--c));
    outline-offset: 4px;
}

/* Móvil: la flecha pasa a ser una barra inferior y el texto usa todo el ancho */
@media (max-width: 599px) {
    .ent-cta {
        grid-template-columns: 1fr;
    }

    .ent-cta__arrow {
        width: auto;
        height: 3.75rem;
        justify-items: end;
        padding-right: 1.5rem;
        border-left: 0;
        border-top: 1px solid rgb(11 16 26 / 0.25);
        font-size: 2.2rem !important;
    }
}

/* Modo claro: el neón sobre fondo claro no da contraste en texto; el acento
   pasa a ser un subrayado tipo marcador detrás de texto oscuro */
html:not(.dark) .ent__title em {
    color: #0f172a;
    background: linear-gradient(transparent 62%, rgb(var(--c) / 0.55) 62%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

html:not(.dark) .ent-cta__kicker {
    color: #334155;
}

@keyframes ent-pulse {
    0% { left: 0; }
    70%, 100% { left: calc(100% - 5px); }
}

@media (prefers-reduced-motion: reduce) {
    .ent__dot,
    .ent__rail::after {
        animation: none;
    }

    .ent__rail::after {
        display: none;
    }

    .ent-cta,
    .ent-cta__fill,
    .ent-cta::after {
        transition: none;
    }
}

/* ── Top 10: ranking compacto (una fila, sin videos) ─────────── */
.top-rail {
    margin: 0 0 2.75rem;
}

.top-rail__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.top-rail__head .material-symbols-outlined {
    font-size: 18px;
    color: #f43f5e;
}

.top-rail__title {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.top-rail__hint {
    margin-left: auto;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.69rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

html.dark .top-rail__hint {
    color: #8391a7;
}

.top-rail__list {
    display: flex;
    gap: 0.6rem;
    margin: 0;
    /* El 8% final se desvanece (mask): el mismo espacio al final deja que el
       último puesto salga completo al llegar al tope del scroll */
    padding: 0.2rem 8% 0.8rem 0.1rem;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgb(var(--color-primary) / 0.4) transparent;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
}

.top-rail__list > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.trank {
    --rk: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 15.5rem;
    padding: 0.4rem 0.95rem 0.4rem 0.4rem;
    border: 1px solid rgb(100 116 139 / 0.2);
    border-radius: 3px;
    background: rgb(255 255 255 / 0.6);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

html.dark .trank {
    border-color: rgb(255 255 255 / 0.07);
    background: rgb(255 255 255 / 0.025);
}

.trank:hover,
.trank:focus-visible {
    border-color: rgb(var(--rk) / 0.6);
    background: rgb(var(--rk) / 0.07);
}

.trank:focus-visible {
    outline: 2px solid rgb(var(--rk));
    outline-offset: 2px;
}

.trank__thumb {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 2px;
    object-fit: cover;
    background: #0d1422;
}

.trank__txt {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.trank__pos {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgb(var(--rk));
}

/* En claro, oro/plata/neón no se leen sobre blanco: texto oscuro y el color
   del puesto como subrayado */
html:not(.dark) .trank__pos {
    color: #0f172a;
    text-decoration: underline 2px rgb(var(--rk));
    text-underline-offset: 3px;
}

.trank__name {
    display: block;
    max-width: 9.5rem;
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.trank__likes {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.69rem;
    font-weight: 700;
    color: #e91e8c;
}

.trank__likes .material-symbols-outlined {
    font-size: 13px;
    font-variation-settings: 'FILL' 1;
}

/* ── Filtros del catálogo ── */
.fchip {
    --c: var(--color-primary, 6 249 148);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 2.3rem;
    padding: 0 0.95rem;
    border: 1px solid rgb(100 116 139 / 0.25);
    border-radius: 2px;
    background: transparent;
    color: #475569;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.4s ease;
}

html.dark .fchip {
    border-color: rgb(255 255 255 / 0.1);
    color: #94a3b8;
}

.fchip__dot {
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background: rgb(var(--c));
    box-shadow: 0 0 8px rgb(var(--c) / 0.7);
}

.fchip__n {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    opacity: 0.6;
}

.fchip:hover {
    border-color: rgb(var(--c) / 0.6);
    color: #0f172a;
}

html.dark .fchip:hover {
    color: #f1f5f9;
}

.fchip.is-active {
    border-color: rgb(var(--c));
    background: rgb(var(--c) / 0.14);
    color: #0f172a;
    box-shadow: 0 0 22px -8px rgb(var(--c) / 0.8), inset 0 -2px 0 rgb(var(--c));
}

html.dark .fchip.is-active {
    color: #fff;
}

.fchip:focus-visible {
    outline: 2px solid rgb(var(--c));
    outline-offset: 2px;
}

/* ── Cards de proyecto ───────────────────────────────────────
   Media con poster instantáneo; el video real se descarga solo
   cuando la card entra en pantalla (main.js). --c = color del
   primer servicio del proyecto. */
.pcard {
    --c: var(--color-primary, 6 249 148);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgb(15 23 42 / 0.08);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.5s ease;
}

html.dark .pcard {
    border-color: rgb(255 255 255 / 0.07);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.035), rgb(255 255 255 / 0.012));
}

.pcard:hover,
.pcard:focus-within {
    border-color: rgb(var(--c) / 0.55);
    box-shadow: 0 26px 60px -32px rgb(var(--c) / 0.7), 0 0 0 1px rgb(var(--c) / 0.2);
}

.pcard__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0d1422;
}

.pcard__media > img,
.pcard__media > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcard:hover .pcard__media > img,
.pcard:hover .pcard__media > video {
    transform: scale(1.06);
}

/* Viñeta inferior para que las etiquetas se lean sobre cualquier media */
.pcard__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(11 16 26 / 0.35) 0%, transparent 28%, transparent 62%, rgb(11 16 26 / 0.6) 100%);
    pointer-events: none;
}

/* Marco HUD + scanline al pasar el mouse */
.pcard__hud {
    position: absolute;
    inset: 10px;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(rgb(var(--c)) 0 0) left top / 14px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left top / 2px 14px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) right top / 14px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) right top / 2px 14px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left bottom / 14px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) left bottom / 2px 14px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) right bottom / 14px 2px no-repeat,
        linear-gradient(rgb(var(--c)) 0 0) right bottom / 2px 14px no-repeat;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcard:hover .pcard__hud {
    opacity: 1;
    transform: scale(1);
}

.pcard__hud::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgb(var(--c) / 0.2), transparent);
    transform: translateY(-100%);
}

.pcard:hover .pcard__hud::after {
    animation: pcard-scan 1.6s linear infinite;
}

/* Etiqueta de tipo: ● VIDEO / IMAGEN / CASO */
.pcard__kind {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.55rem;
    border-radius: 2px;
    background: rgb(11 16 26 / 0.72);
    color: #e2e8f0;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pcard__kind::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgb(var(--c));
}

/* Cuando el video corre, el punto late como "en vivo" */
.pcard.is-live .pcard__kind::before {
    background: #ff3355;
    box-shadow: 0 0 8px #ff3355;
    animation: ai-pulse 1.2s ease-in-out infinite;
}

.pcard__cta {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 2px;
    background: rgb(var(--c));
    color: #0B101A;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transform: translateY(calc(100% + 1rem));
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcard__cta .material-symbols-outlined {
    font-size: 15px;
}

.pcard:hover .pcard__cta,
.pcard:focus-within .pcard__cta {
    transform: none;
}

/* Portada generada por código para proyectos sin media */
.pcard__cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 15% 0%, rgb(var(--c1) / 0.5), transparent 60%),
        radial-gradient(100% 80% at 100% 100%, rgb(var(--c2) / 0.45), transparent 60%),
        #0d1422;
}

.pcard__cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}

.pcard__cover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgb(var(--c1) / 0.22), transparent);
    animation: pcard-scan 4s linear infinite;
}

.pcard__initials {
    position: relative;
    z-index: 1;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 0 30px rgb(var(--c1) / 0.9);
}

.pcard__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1.05rem 1.15rem 1rem;
}

.pcard__meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.69rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

html.dark .pcard__meta {
    color: #8391a7;
}

.pcard__idx {
    font-weight: 700;
    color: rgb(var(--c));
}

.pcard__loc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcard__flag {
    flex-shrink: 0;
    width: auto;
    height: 12px;
    border-radius: 2px;
    opacity: 0.85;
}

.pcard__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.pcard__link {
    color: inherit;
    text-decoration: none;
}

/* Toda la card es clicable sin meter botones dentro de un <a> */
.pcard__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
}

.pcard__link:focus-visible {
    outline: none;
}

.pcard__link:focus-visible::after {
    outline: 2px solid rgb(var(--c));
    outline-offset: -2px;
    border-radius: 6px;
}

.pcard__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pcard__tags li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgb(var(--t) / 0.35);
    border-radius: 2px;
    background: rgb(var(--t) / 0.08);
    color: #334155;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

html.dark .pcard__tags li {
    color: #cbd5e1;
}

.pcard__tags li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: rgb(var(--t));
    box-shadow: 0 0 8px rgb(var(--t) / 0.8);
}

.pcard__tags .pcard__more {
    --t: 100 116 139;
}

.pcard__tags .pcard__more::before {
    display: none;
}

.pcard__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 0.7rem 1.15rem;
    border-top: 1px solid rgb(15 23 42 / 0.06);
}

html.dark .pcard__foot {
    border-top-color: rgb(255 255 255 / 0.06);
}

.pcard__like {
    position: relative;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: #64748b;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

html.dark .pcard__like {
    color: #8391a7;
}

.pcard__like .material-symbols-outlined {
    font-size: 17px;
}

.pcard__like:hover,
.pcard__like.is-liked {
    color: #e91e8c;
}

.pcard__like:hover {
    border-color: rgb(233 30 140 / 0.35);
    background: rgb(233 30 140 / 0.06);
}

.pcard__like.is-liked .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

.pcard__like:focus-visible {
    outline: 2px solid #e91e8c;
    outline-offset: 2px;
}

.pcard__go {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgb(var(--c));
}

html:not(.dark) .pcard__go {
    color: #0f172a;
}

.pcard__go .material-symbols-outlined {
    font-size: 16px;
    color: rgb(var(--c));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcard:hover .pcard__go .material-symbols-outlined {
    transform: translate(2px, -2px);
}

@keyframes pcard-scan {
    from { transform: translateY(-100%); }
    to { transform: translateY(340%); }
}

/* ── Reduced motion: nada se mueve solo ── */
@media (prefers-reduced-motion: reduce) {
    .dbtn,
    .dbtn::before,
    .dbtn::after,
    .dbtn__icon,
    .ai-card__icon,
    .pcard__media > img,
    .pcard__media > video,
    .pcard__hud,
    .pcard__cta {
        transition: none;
    }

    .ai-core__dot,
    .ai-core__caret,
    .ai-card::after,
    .pcard__cover::after,
    .pcard:hover .pcard__hud::after,
    .pcard.is-live .pcard__kind::before {
        animation: none;
    }

    .ai-card::after {
        display: none;
    }

    .pcard:hover .pcard__media > img,
    .pcard:hover .pcard__media > video {
        transform: none;
    }
}
