/* ==========================================================================
   Portada: hero con retrato, manifiesto, rutas de exploracion y llamada final.
   Lo compartido con el resto de paginas esta en base.css.
   ========================================================================== */

/* -- Hero ------------------------------------------------------------------ */

.hero {
    min-height: 100svh;
    padding: 150px clamp(24px, 8vw, 140px) 100px;
    position: relative;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(40px, 7vw, 110px);
    border-bottom: 1px solid var(--line);
}

/* Linea vertical que ancla la composicion al borde izquierdo. */
.hero::before {
    content: "";
    position: absolute;
    left: 7%;
    top: 78px;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}

.glow-one {
    width: 420px;
    height: 420px;
    right: 5%;
    top: 15%;
    background: rgba(49, 81, 255, 0.14);
}

.glow-two {
    width: 260px;
    height: 260px;
    left: 30%;
    bottom: 10%;
    background: rgba(113, 45, 255, 0.08);
}

/* En la portada la escena cruza el hero entero por detras del retrato. El velo
   va anclado al bloque de texto, no a todo el lienzo: sin el, el contraste cae
   por debajo del minimo AA. Oscurecer el hero completo cumpliria igual, pero
   apagaria toda la escena para proteger una esquina. Solo el lienzo del hero:
   el de las tarjetas de ruta no tiene texto encima que proteger. */
.home-hero > .hero-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 42% 56% at 25% 52%,
            rgba(5, 6, 9, 0.96) 0%,
            rgba(5, 6, 9, 0.92) 70%,
            rgba(5, 6, 9, 0.55) 90%,
            rgba(5, 6, 9, 0) 100%),
        linear-gradient(0deg, var(--bg), transparent 26%);
}

.hero-content {
    max-width: 820px;
    position: relative;
    z-index: 2;
}

.hero-lead {
    max-width: 670px;
    margin-bottom: 34px;
    color: var(--muted);
    font-size: clamp(15px, 1.25vw, 19px);
    line-height: 1.75;
}

.hero-lead strong {
    color: var(--text);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-social {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 44px;
    color: var(--muted);
    font: 400 10px var(--mono);
}

.hero-social > span {
    font-size: 8px;
    letter-spacing: 0.15em;
}

.hero-social a {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.hero-social a:hover {
    color: #fff;
}

/* -- Retrato ---------------------------------------------------------------
   El diseno dejaba aqui un monograma de relleno. Con una fotografia real el
   marco ya tiene suficiente peso visual, asi que no lleva los anillos: la
   foto es el elemento fuerte y el resto acompana.
   ------------------------------------------------------------------------- */

.hero-portrait {
    position: relative;
    z-index: 2;
    justify-self: center;
}

.portrait-frame {
    width: min(36vw, 480px);
    aspect-ratio: 0.83;
    position: relative;
    border: 1px solid rgba(113, 142, 255, 0.25);
    background:
        radial-gradient(circle at 50% 40%, rgba(64, 91, 207, 0.2), transparent 31%),
        linear-gradient(155deg, #0c0f18, #08090d);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

/* Vineta sobre la fotografia: el retrato esta tomado sobre fondo claro y sin
   esto se recorta contra la pagina en lugar de integrarse en el marco. */
.portrait-frame::after {
    content: "";
    position: absolute;
    inset: 14px;
    z-index: 1;
    border: 1px solid var(--line);
    background: radial-gradient(ellipse at 50% 32%, transparent 38%, rgba(5, 6, 9, 0.62) 100%);
    pointer-events: none;
}

.portrait-photo {
    position: absolute;
    top: 14px;
    left: 14px;
    width: calc(100% - 28px);
    height: calc(100% - 28px);
    object-fit: cover;
    object-position: center 20%;
    filter: saturate(0.72) contrast(1.08) brightness(0.76);
    /* Se funde con el marco por abajo para que la etiqueta se lea sin caja. */
    mask-image: linear-gradient(180deg, #000 58%, rgba(0, 0, 0, 0.25));
}

.portrait-grid {
    position: absolute;
    inset: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(rgba(89, 126, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(89, 126, 255, 0.15) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(black, transparent 85%);
}

.portrait-label {
    position: absolute;
    bottom: 30px;
    left: 34px;
    z-index: 2;
    margin: 0;
}

.portrait-label span,
.portrait-label small {
    display: block;
    font-family: var(--mono);
}

.portrait-label span {
    font-size: 13px;
    letter-spacing: 0.14em;
}

.portrait-label small {
    margin-top: 5px;
    color: var(--cyan);
    font-size: 7px;
    letter-spacing: 0.18em;
}

.status-card {
    position: absolute;
    z-index: 3;
    min-width: 172px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 12, 18, 0.87);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    animation: float 5s ease-in-out infinite;
}

.status-card svg {
    color: #7894ff;
    flex-shrink: 0;
}

.status-card small,
.status-card strong {
    display: block;
    font-family: var(--mono);
}

.status-card small {
    color: var(--cyan);
    font-size: 6px;
    letter-spacing: 0.15em;
}

.status-card strong {
    margin-top: 3px;
    font-size: 9px;
    font-weight: 400;
}

.status-code {
    top: 14%;
    left: -50px;
}

.status-security {
    top: 43%;
    right: -60px;
    animation-delay: -1.5s;
}

.status-ai {
    bottom: 12%;
    left: -45px;
    animation-delay: -3s;
}

@keyframes float {
    50% {
        transform: translateY(-8px);
    }
}

/* -- Manifiesto ------------------------------------------------------------ */

.manifesto {
    padding: 120px clamp(24px, 8vw, 140px);
    display: grid;
    grid-template-columns: 0.38fr 1.2fr 0.7fr;
    gap: 60px;
    border-bottom: 1px solid var(--line);
}

.home-manifesto {
    padding-bottom: 80px;
}

.manifesto-main {
    position: relative;
}

.quote-mark {
    position: absolute;
    left: -35px;
    top: -45px;
    margin: 0;
    color: rgba(98, 125, 255, 0.2);
    font: 300 100px Georgia, 'Times New Roman', serif;
}

.manifesto h2 {
    margin: 0;
    font-size: clamp(35px, 4.3vw, 68px);
    line-height: 1.06;
    letter-spacing: -0.055em;
    font-weight: 600;
    text-wrap: balance;
}

.manifesto-copy {
    padding-top: 10px;
}

.manifesto-copy p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

/* -- Terminal del manifiesto -----------------------------------------------
   Llena la franja que quedaba vacia bajo el manifiesto. El contenido es texto
   normal y no una imagen: se selecciona, se copia y se indexa.
   ------------------------------------------------------------------------- */

.terminal {
    grid-column: 2 / -1;
    margin-top: 55px;
    overflow: hidden;
    border: 1px solid rgba(84, 240, 174, 0.22);
    border-radius: 11px;
    background: linear-gradient(165deg, #080b10, #05070b);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
}

.terminal-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.terminal-bar i:first-child {
    background: rgba(255, 96, 92, 0.65);
}

.terminal-bar i:nth-child(2) {
    background: rgba(255, 189, 68, 0.6);
}

.terminal-bar i:nth-child(3) {
    background: rgba(84, 240, 174, 0.6);
}

.terminal-bar span {
    margin-left: 10px;
    color: #7e8899;
    font: 400 10px var(--mono);
    letter-spacing: 0.06em;
}

.terminal-body {
    padding: 24px clamp(18px, 2.4vw, 30px) 28px;
    font: 400 13px var(--mono);
    line-height: 1.9;
}

.terminal-cmd {
    margin: 0;
    color: #e8ecf2;
}

.terminal-cmd span {
    color: var(--green);
}

.terminal-out {
    margin: 6px 0 22px;
}

.terminal-out > div {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
}

.terminal-out dt {
    color: var(--cyan);
}

.terminal-out dd {
    margin: 0;
    color: #9aa3b2;
}

.terminal-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 0;
    color: var(--green);
}

.terminal-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px var(--green);
    animation: pulse 2s infinite;
}

/* -- Rutas de exploracion -------------------------------------------------- */

.home-paths {
    background: #07080c;
}

.path-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.path-card {
    min-height: 220px;
    padding: 35px;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 28px;
    align-items: start;
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: 0.35s;
}

.path-card:hover {
    background: rgba(69, 92, 207, 0.08);
}

.path-card > span {
    color: #7189e7;
    font: 400 9px var(--mono);
}

.path-card h3 {
    margin: 0 0 13px;
    font-size: 25px;
    letter-spacing: -0.035em;
}

.path-card p {
    max-width: 360px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

/* -- Figuras de las tarjetas de ruta ---------------------------------------
   La mitad inferior de cada tarjeta estaba vacia. La llena una figura que gira
   en 3D, hecha solo con transformaciones CSS: no abre un segundo contexto
   WebGL ni suma un byte de descarga, y con movimiento reducido se queda quieta
   porque base.css anula todas las animaciones.
   ------------------------------------------------------------------------- */

/* Cuando el lienzo 3D esta listo dibuja su figura en el mismo sitio, y la de
   CSS se retira para que no se vean las dos a la vez. */
.path-stage.is-ready ~ .path-card .path-shape span {
    opacity: 0;
}

.path-shape {
    position: absolute;
    right: 26px;
    bottom: 12px;
    width: 176px;
    height: 156px;
    perspective: 480px;
    pointer-events: none;
    opacity: 0.78;
    transition: opacity 0.35s;
}

.path-card:hover .path-shape,
.path-card:focus-visible .path-shape {
    opacity: 1;
}

/* Oscila en vez de dar la vuelta entera: una figura plana girando 360 grados
   se queda de canto la mitad del tiempo y desaparece. */
.path-shape span {
    position: absolute;
    inset: 0;
    display: block;
    transition: opacity 0.6s;
    transform-style: preserve-3d;
    animation: shape-sway 15s ease-in-out infinite;
}

.path-shape i {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
}

@keyframes shape-sway {
    0%,
    100% {
        transform: rotateY(-27deg);
    }

    50% {
        transform: rotateY(27deg);
    }
}

@keyframes shape-turn {
    to {
        transform: rotateY(360deg);
    }
}

/* Historia: arcos apilados, el remolino de etapas que no fue una linea recta. */
.shape-espiral i {
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    border: 1px solid rgba(90, 128, 255, 0.75);
    border-top-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
}

.shape-espiral i:nth-child(1) { transform: translateY(-34px) rotateX(58deg) scale(0.46); border-right-color: var(--cyan); border-bottom-color: var(--cyan); }
.shape-espiral i:nth-child(2) { transform: translateY(-17px) rotateX(58deg) scale(0.72); }
.shape-espiral i:nth-child(3) { transform: rotateX(58deg); }
.shape-espiral i:nth-child(4) { transform: translateY(17px) rotateX(58deg) scale(0.72); border-right-color: rgba(139, 92, 246, 0.85); border-bottom-color: rgba(139, 92, 246, 0.85); }
.shape-espiral i:nth-child(5) { transform: translateY(34px) rotateX(58deg) scale(0.46); border-right-color: rgba(139, 92, 246, 0.6); border-bottom-color: rgba(139, 92, 246, 0.6); }

/* Proyectos: nodos a distintas profundidades. Una esfera nunca se queda de
   canto, asi que esta si puede dar la vuelta entera. */
.shape-nodos span {
    animation: shape-turn 26s linear infinite;
}

.shape-nodos i {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 18px rgba(65, 105, 255, 0.9);
}

.shape-nodos i:nth-child(1) { transform: translate3d(-40px, -32px, 36px); }
.shape-nodos i:nth-child(2) { transform: translate3d(34px, -16px, -28px); background: var(--cyan); box-shadow: 0 0 18px rgba(83, 231, 255, 0.9); }
.shape-nodos i:nth-child(3) { transform: translate3d(-4px, 6px, 12px) scale(1.6); }
.shape-nodos i:nth-child(4) { transform: translate3d(42px, 34px, 24px); background: var(--violet); box-shadow: 0 0 18px rgba(139, 92, 246, 0.9); }
.shape-nodos i:nth-child(5) { transform: translate3d(-36px, 36px, -32px) scale(0.85); }

/* Mas alla del codigo: escudos encajados, lo que se protege. */
.shape-escudo i {
    clip-path: polygon(50% 0, 100% 20%, 100% 58%, 50% 100%, 0 58%, 0 20%);
    background: rgba(84, 240, 174, 0.14);
}

.shape-escudo i:nth-child(1) { width: 96px; height: 108px; margin: -54px 0 0 -48px; transform: translateZ(-26px); background: rgba(65, 105, 255, 0.1); }
.shape-escudo i:nth-child(2) { width: 74px; height: 83px; margin: -42px 0 0 -37px; transform: translateZ(-4px); }
.shape-escudo i:nth-child(3) { width: 52px; height: 58px; margin: -29px 0 0 -26px; transform: translateZ(18px); background: rgba(84, 240, 174, 0.3); }
.shape-escudo i:nth-child(4),
.shape-escudo i:nth-child(5) { display: none; }

/* Stack: capas isometricas, una por nivel. */
.shape-capas i {
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border: 1px solid rgba(90, 128, 255, 0.8);
    background: rgba(65, 105, 255, 0.12);
}

.shape-capas i:nth-child(1) { transform: translateY(-32px) rotateX(56deg) rotateZ(45deg) scale(0.82); border-color: var(--cyan); background: rgba(83, 231, 255, 0.12); }
.shape-capas i:nth-child(2) { transform: translateY(-16px) rotateX(56deg) rotateZ(45deg) scale(0.91); }
.shape-capas i:nth-child(3) { transform: rotateX(56deg) rotateZ(45deg); }
.shape-capas i:nth-child(4) { transform: translateY(16px) rotateX(56deg) rotateZ(45deg) scale(0.91); border-color: rgba(139, 92, 246, 0.8); background: rgba(139, 92, 246, 0.1); }
.shape-capas i:nth-child(5) { transform: translateY(32px) rotateX(56deg) rotateZ(45deg) scale(0.82); border-color: rgba(139, 92, 246, 0.55); }

.path-card > svg {
    color: #77808f;
    transition: transform 0.3s, color 0.3s;
}

.path-card:hover > svg,
.path-card:focus-visible > svg {
    transform: translateX(7px);
    color: #fff;
}

/* -- Llamada final --------------------------------------------------------- */

.home-cta {
    padding: 130px 24px;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, rgba(59, 78, 181, 0.16), transparent 36%);
}

/* Rejilla tenue detras de la llamada final: esta franja estaba entera en negro
   y sin nada. Se desvanece hacia los bordes para no encajonar el bloque. */
.home-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(81, 113, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(81, 113, 255, 0.16) 1px, transparent 1px);
    background-size: 64px 64px;
    /* Anillo, no mancha: en los cruces la rejilla aclaraba el fondo hasta
       rgb(35,45,101) y el azul del titular caia a 2,87:1. Dejando hueco en el
       centro, el texto conserva su fondo oscuro y la rejilla se ve alrededor. */
    mask-image: radial-gradient(ellipse 62% 78% at 50% 50%,
        transparent 42%,
        rgba(0, 0, 0, 0.85) 72%,
        transparent 100%);
    pointer-events: none;
}

/* La rejilla va posicionada, asi que sin esto pintaria por encima del texto. */
.home-cta > * {
    position: relative;
    z-index: 1;
}

.home-cta > p {
    color: #8493cf;
    font: 400 9px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-cta h2 {
    margin: 25px 0 40px;
    font-size: clamp(40px, 5vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

/* -- Tablet ---------------------------------------------------------------- */

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 130px;
    }

    .hero-portrait {
        grid-row: 1;
    }

    .hero-content {
        grid-row: 2;
    }

    .portrait-frame {
        width: min(78vw, 430px);
    }

    .manifesto {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .terminal {
        grid-column: 1 / -1;
        margin-top: 20px;
    }

    .path-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Movil ----------------------------------------------------------------- */

@media (max-width: 640px) {
    .hero {
        padding: 110px 22px 80px;
        gap: 60px;
    }

    .hero::before {
        display: none;
    }

    .portrait-frame {
        width: 82vw;
    }

    .status-card {
        min-width: 140px;
        padding: 10px;
    }

    .status-code {
        left: -10px;
    }

    .status-security {
        right: -10px;
    }

    /* Con el marco a 82vw esta tarjeta caia justo encima de la etiqueta
       ALVARO.EXE, asi que sube para dejarla legible. */
    .status-ai {
        left: 0;
        bottom: 26%;
    }

    .hero-social {
        flex-wrap: wrap;
    }

    .hero-social > span {
        width: 100%;
    }

    .manifesto {
        padding: 90px 22px;
    }

    .quote-mark {
        left: -12px;
        top: -32px;
        font-size: 72px;
    }

    /* A esta anchura la etiqueta y su valor no caben en la misma linea. */
    .terminal-out > div {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 10px;
    }

    .terminal-body {
        font-size: 12px;
        line-height: 1.75;
    }

    .path-card {
        min-height: 190px;
        padding: 26px;
        gap: 18px;
    }

    /* La figura se comeria el texto en una tarjeta tan estrecha. */
    .path-shape {
        right: 14px;
        bottom: 10px;
        width: 104px;
        height: 92px;
        opacity: 0.5;
    }
}
