/* =========================================================================
   about.css — Sobre mí: retrato con marco geométrico, texto desarrollado,
   datos clave en una línea y terminal interactiva.
   ========================================================================= */

/* Escritorio: retrato a la izquierda; introducción y relato a la derecha.
   Móvil: introducción → retrato → relato → indicadores. */
.about-grid {
    display: grid;
    grid-template-areas: "intro" "photo" "body";
    gap: 34px;
    align-items: start;
}

.about-intro { grid-area: intro; min-width: 0; }
.portrait { grid-area: photo; }
.about-body { grid-area: body; min-width: 0; }

@media (min-width: 1000px) {
    .about-grid {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        grid-template-areas: "photo intro" "photo body";
        grid-template-rows: auto 1fr;
        column-gap: clamp(56px, 7vw, 110px);
        row-gap: 30px;
    }

    .portrait { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
}

/* ------------------------------ Retrato ------------------------------ */
/* Las piezas decorativas viven dentro del bloque: nada sobresale en móvil. */
.portrait {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 400 / 480;
    justify-self: center;
    isolation: isolate;
}

@media (max-width: 999px) {
    .portrait { width: min(100%, 330px); }
}

/* Luz ambiental detrás del retrato */
.portrait::before {
    content: "";
    position: absolute;
    inset: 14% 10% 10%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(37, 99, 235, 0.55), rgba(99, 102, 241, 0.12) 60%, transparent);
    filter: blur(30px);
}

.portrait-geo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.geo-hex {
    fill: none;
    stroke: url(#pg-line);
    stroke-width: 1.2;
}

.geo-hex--a {
    opacity: 0.55;
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
}

.geo-hex--b {
    stroke: rgba(147, 197, 253, 0.18);
    stroke-dasharray: 3 7;
}

/* Destello que recorre el contorno del hexágono */
.geo-hex--run {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 7 93;
    filter: drop-shadow(0 0 6px var(--cyan));
    opacity: 0;
}

.portrait.is-visible .geo-hex--run { animation: fade-in-node 600ms ease 2s forwards, geo-run 9s linear 2s infinite; }
@keyframes geo-run { to { stroke-dashoffset: -100; } }

.geo-ticks { fill: none; stroke: rgba(147, 197, 253, 0.5); stroke-width: 1.4; }
.geo-corner { fill: none; stroke: var(--blue); stroke-width: 1.5; opacity: 0.6; transition: opacity var(--mid) ease, transform 600ms var(--ease); transform-origin: center; }
.portrait:hover .geo-corner { opacity: 1; }

.geo-node { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); opacity: 0; }

.portrait.is-visible .geo-hex--a { animation: geo-draw 2.2s var(--ease) 200ms forwards; }
.portrait.is-visible .geo-node { animation: fade-in-node 600ms ease forwards; animation-delay: 1.4s; }
.portrait.is-visible .geo-node--live { animation: fade-in-node 600ms ease 1.6s forwards, node-blink 3s ease-in-out 2.4s infinite; }

@keyframes geo-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in-node { to { opacity: 1; } }
@keyframes node-blink { 50% { opacity: 0.35; } }

/* Perspectiva: el retrato se inclina levemente siguiendo el puntero. */
.portrait { perspective: 900px; }

.portrait-tilt {
    position: absolute;
    inset: 0;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 700ms var(--ease);
}

.portrait.is-tilting .portrait-tilt { transition: transform 120ms linear; }

/* Borde luminoso del hexágono interior; se intensifica con el puntero */
.portrait-edge {
    position: absolute;
    inset: 10.4% 11.5%;
    clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
    background: conic-gradient(from var(--edge, 200deg), transparent 0 60%, rgba(34, 211, 238, 0.9) 75%, rgba(99, 102, 241, 0.8) 85%, transparent 95%);
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
    transition: opacity var(--mid) ease;
}

.portrait:hover .portrait-edge { opacity: 0.85; }

/* La foto se recorta en un hexágono interior; no se altera la imagen. */
.portrait-frame {
    position: absolute;
    inset: calc(10.4% + 2px) calc(11.5% + 2px);
    z-index: 1;
    overflow: hidden;
    clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
    background: var(--surface-solid);
}

.portrait-frame picture { position: absolute; inset: 0; }

.portrait-frame img {
    width: 100%;
    height: 112%;
    object-fit: cover;
    object-position: 50% 28%;
    transform: translate3d(0, var(--py, -4%), 0);
    will-change: transform;
}

/* Iluminación sutil encima de la foto (capa independiente) */
.portrait-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 62%, color-mix(in srgb, var(--ink) 55%, transparent)),
        linear-gradient(120deg, rgba(147, 197, 253, 0.16), transparent 36%);
    pointer-events: none;
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 18px 2px rgba(34, 211, 238, 0.6);
    opacity: 0;
}

.portrait-tag {
    position: absolute;
    left: 50%;
    bottom: 1%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 92%;
    padding: 8px 16px 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 86%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
    white-space: nowrap;
}

.portrait-tag > span:last-child {
    display: grid;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.portrait-tag b {
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* -------------------------------- Texto -------------------------------- */
.about-title {
    margin-top: 18px;
    font-family: var(--display);
    font-size: clamp(1.85rem, 1.2rem + 2.3vw, 3rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.about-title .mask { display: block; }

.about-title em {
    font-style: normal;
    background: linear-gradient(90deg, var(--blue-pale), var(--blue) 55%, var(--indigo));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.about-lead {
    max-width: 60ch;
    margin-top: 22px;
    color: var(--text);
    font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
    line-height: 1.7;
}

.about-lead strong { color: var(--accent-text); font-weight: 600; }

/* Relato editorial: etiqueta lateral + párrafo, unidos por una guía vertical */
.about-story {
    position: relative;
    display: grid;
    gap: 6px;
    max-width: 68ch;
}

.about-story li {
    position: relative;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 4px 22px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.about-story li:first-child { border-top: 0; padding-top: 0; }

.story-label {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
}

.story-label i {
    color: var(--blue);
    font-family: var(--mono);
    font-size: 0.66rem;
    font-style: normal;
    letter-spacing: 0.1em;
}

.about-story p {
    color: var(--text-soft);
    font-size: 0.98rem;
    line-height: 1.75;
}

.about-story li::before {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    transition: width 700ms var(--ease);
}

.about-story li:first-child::before { display: none; }
.about-story li:hover::before { width: 60%; }

@media (max-width: 560px) {
    .about-story li { grid-template-columns: 1fr; padding: 16px 0; }
}

/* Indicadores profesionales: línea con icono y acento de color propio */
.about-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
}


.about-facts > div {
    position: relative;
    padding: 12px 14px 13px;
    overflow: hidden;
    border-left: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
    border-radius: 2px 12px 12px 2px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 9%, transparent), transparent 85%);
    transition: transform var(--mid) var(--ease), background-color var(--mid) ease;
}

.about-facts > div:hover { transform: translateX(3px); }

.about-facts dt {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.about-facts dt .i { color: var(--c); font-size: 0.85rem; }

.about-facts dd {
    margin-top: 6px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.about-facts dd small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 400;
}

[data-theme="light"] .about-facts > div[style*="#f7df1e"] { --c: #ca8a04; }
[data-theme="light"] .geo-ticks { stroke: rgba(37, 99, 235, 0.45); }

@media (prefers-reduced-motion: reduce) {
    .portrait-tilt { transition: none; }
    .portrait.is-visible .geo-hex--run { animation: none; opacity: 0.6; }
}
