/* ===========================================================
   Roy Ruddy Paz — Portafolio AI/ML · Tema neón oscuro / cyber
   =========================================================== */

:root {
    --bg:        #05060a;
    --bg-soft:   #0a0d16;
    --panel:     rgba(18, 22, 36, 0.55);
    --panel-brd: rgba(120, 160, 255, 0.14);
    --text:      #e8ecf6;
    --muted:     #8b94ad;
    --cyan:      #00e5ff;
    --violet:    #a060ff;
    --pink:      #ff3da6;
    --glow-cyan: rgba(0, 229, 255, 0.55);
    --grad:      linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--pink));
    --font:      'Space Grotesk', system-ui, sans-serif;
    --mono:      'JetBrains Mono', ui-monospace, monospace;
    --maxw:      1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Fondo animado ---------- */
#bg-canvas { position: fixed; inset: 0; z-index: -3; }

.grid-overlay {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image:
        linear-gradient(rgba(120,160,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120,160,255,0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}

.scanline {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.4;
    background: repeating-linear-gradient(
        to bottom, transparent 0, transparent 2px, rgba(0,0,0,0.18) 3px, transparent 4px);
}

/* ---------- Navegación ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem clamp(1.2rem, 5vw, 3rem);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, padding .3s;
}
.nav::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    backdrop-filter: blur(12px);
    background: rgba(5, 6, 10, 0.45);
    transition: background .3s;
}
.nav.scrolled { border-color: var(--panel-brd); padding-block: 0.8rem; }
.nav.scrolled::before { background: rgba(5,6,10,0.8); }
.nav__logo { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; letter-spacing: 1px; }
.nav__logo span { color: var(--cyan); animation: blink 1.2s steps(2) infinite; }
.nav__links { display: flex; gap: 1.8rem; align-items: center; }
.nav__links a { font-size: .95rem; color: var(--muted); transition: color .2s; position: relative; }
.nav__links a:hover { color: var(--text); }
.nav__links a:not(.nav__cta)::after {
    content: ''; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
    background: var(--cyan); transition: width .25s; box-shadow: 0 0 8px var(--glow-cyan);
}
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
    border: 1px solid var(--panel-brd); padding: .45rem 1rem; border-radius: 999px;
    color: var(--text) !important;
}
.nav__cta:hover { border-color: var(--cyan); box-shadow: 0 0 16px var(--glow-cyan); }
.nav__burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); transition: .3s; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; font-weight: 600; font-size: .95rem;
    padding: .8rem 1.6rem; border-radius: 999px; cursor: pointer;
    transition: transform .2s, box-shadow .25s, background .25s; border: 1px solid transparent;
}
.btn--primary { background: var(--grad); color: #06070d; box-shadow: 0 0 24px rgba(0,229,255,.3); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,229,255,.55); }
.btn--ghost { border-color: var(--panel-brd); color: var(--text); }
.btn--ghost:hover { border-color: var(--cyan); box-shadow: 0 0 16px var(--glow-cyan); transform: translateY(-2px); }
.btn--lg { padding: 1rem 2.2rem; font-size: 1.05rem; font-family: var(--mono); }
.btn--whatsapp {
    display: inline-flex; align-items: center; gap: .6rem;
    background: linear-gradient(135deg, #25d366, #128c7e); color: #fff;
    box-shadow: 0 0 24px rgba(37,211,102,.35);
}
.btn--whatsapp:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(37,211,102,.6); }
.btn--whatsapp svg { flex-shrink: 0; }

/* ---------- Layout secciones ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 10vw, 7rem) clamp(1.2rem, 5vw, 2rem); }
.section__head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2.8rem; }
.section__index { font-family: var(--mono); color: var(--cyan); font-size: 1rem; opacity: .8; }
.section__title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.5px; }

.grad {
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- HERO ---------- */
.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 7rem clamp(1.2rem, 5vw, 2rem) 4rem; position: relative;
}
.hero__inner { max-width: 860px; }
.hero__avatar { position: relative; width: 150px; height: 150px; margin: 0 auto 1.8rem; }
.hero__avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    border: 2px solid rgba(0,229,255,.4); position: relative; z-index: 2;
    box-shadow: 0 0 30px rgba(0,229,255,.35), inset 0 0 20px rgba(0,0,0,.4);
}
.hero__avatar-ring {
    position: absolute; inset: -8px; border-radius: 50%; z-index: 1;
    background: conic-gradient(from 0deg, var(--cyan), var(--violet), var(--pink), var(--cyan));
    filter: blur(6px); opacity: .8; animation: spin 6s linear infinite;
}
.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .55rem; font-family: var(--mono);
    font-size: .85rem; color: var(--muted); border: 1px solid var(--panel-brd);
    padding: .4rem 1rem; border-radius: 999px; background: var(--panel); margin-bottom: 1.6rem;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2bff88; box-shadow: 0 0 10px #2bff88; animation: pulse 1.8s infinite; transition: background .3s, box-shadow .3s; }
/* El punto del hero refleja el estado del WebSocket */
.hero__eyebrow .dot.is-live { background: #2ee66e; box-shadow: 0 0 10px #2ee66e; }
.hero__eyebrow .dot.is-off  { background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; }
.hero__title { font-size: clamp(2.6rem, 8vw, 5.2rem); font-weight: 700; line-height: 1.05; letter-spacing: -1.5px; }
.hero__role {
    font-family: var(--mono); font-size: clamp(1rem, 3vw, 1.5rem); color: var(--cyan);
    margin: 1rem 0 1.4rem; min-height: 1.6em;
}
.hero__role::after { content: '▋'; animation: blink 1s steps(2) infinite; color: var(--cyan); }
.hero__tagline { color: var(--muted); max-width: 620px; margin: 0 auto 2.2rem; font-size: 1.08rem; }
.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero__stats {
    display: flex; gap: clamp(1.5rem, 6vw, 4rem); justify-content: center; margin-top: 3.5rem; flex-wrap: wrap;
}
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; }
.hero__stats strong.plus::after { content: '+'; color: var(--cyan); }
.hero__stats span { font-size: .82rem; color: var(--muted); font-family: var(--mono); }
.hero__scroll {
    position: absolute; bottom: 2rem; font-size: 1.4rem; color: var(--muted);
    animation: bounce 2s infinite;
}

/* ---------- Contribuciones ---------- */
.contrib {
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 18px;
    padding: 1.8rem; backdrop-filter: blur(8px);
}
.contrib__sub { color: var(--muted); margin-bottom: 1.4rem; font-size: 1rem; }
.contrib__chart { overflow-x: auto; padding-bottom: .5rem; }
.contrib__chart img { width: 100%; min-width: 680px; display: block; }
.contrib__link {
    display: inline-block; margin-top: 1.3rem; font-family: var(--mono); font-size: .85rem;
    color: var(--cyan); transition: text-shadow .2s;
}
.contrib__link:hover { text-shadow: 0 0 10px var(--glow-cyan); }

/* ---------- Sobre mí ---------- */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }
.about__text p { margin-bottom: 1.1rem; color: #c3cadd; font-size: 1.05rem; }
.about__text strong { color: var(--text); }
.about__card {
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 16px;
    padding: 1.6rem; backdrop-filter: blur(8px);
}
.about__card h3 { font-family: var(--mono); font-size: .9rem; color: var(--cyan); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.kv { list-style: none; }
.kv li { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed rgba(255,255,255,.06); font-size: .95rem; }
.kv li:last-child { border: none; }
.kv span { color: var(--muted); }
.kv .ok { color: #2bff88; }

/* ---------- Skills · Diagrama de infraestructura ---------- */
.section--infra { max-width: 1200px; }
.infra__intro { color: var(--muted); max-width: 780px; margin: -1rem 0 2.6rem; font-size: 1.03rem; }
.infra__intro strong { color: var(--text); }
.infra__hint { display: block; margin-top: .55rem; font-family: var(--mono); font-size: .8rem; color: var(--cyan); opacity: .85; }

.infra { position: relative; display: flex; flex-direction: column; gap: 3.4rem; }
.infra__svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none; overflow: visible;
}

/* Zonas de red */
.izone { position: relative; border: 1px dashed rgba(120,160,255,.22); border-radius: 20px; padding: 2rem 1.1rem 1.15rem; }
.izone__tag {
    position: absolute; top: -.95em; left: 1.1rem; z-index: 2;
    font-family: var(--mono); font-size: .74rem; letter-spacing: .5px;
    padding: .3rem .85rem; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--panel-brd); color: var(--muted);
}
.izone__row { display: grid; gap: 3.4rem 1.1rem; }

.izone--net  { border-color: rgba(160,96,255,.4); background: rgba(160,96,255,.03); }
.izone--net .izone__tag  { color: var(--violet); border-color: rgba(160,96,255,.5); }
.izone--net .izone__row  { grid-template-columns: repeat(5, 1fr); }

.izone--edge { border-color: rgba(255,61,166,.4); background: rgba(255,61,166,.03); }
.izone--edge .izone__tag { color: var(--pink); border-color: rgba(255,61,166,.5); }
.izone--edge .izone__row { grid-template-columns: repeat(3, 1fr); max-width: 780px; margin: 0 auto; }

.izone--dmz  { border-color: rgba(255,180,84,.45); background: rgba(255,180,84,.03); }
.izone--dmz .izone__tag  { color: #ffb454; border-color: rgba(255,180,84,.55); }
.izone--dmz .izone__row  { grid-template-columns: repeat(2, 1fr); max-width: 680px; margin: 0 auto; }

.izone--lan  { border-color: rgba(0,229,255,.4); background: rgba(0,229,255,.025); }
.izone--lan .izone__tag  { color: var(--cyan); border-color: rgba(0,229,255,.5); }
.izone--lan .izone__row  { grid-template-columns: repeat(4, 1fr); }

.izone--lab  { border-color: rgba(43,255,136,.35); background: rgba(43,255,136,.02); }
.izone--lab .izone__tag  { color: #2bff88; border-color: rgba(43,255,136,.45); }
.izone--lab .izone__row  { grid-template-columns: repeat(3, 1fr); max-width: 900px; margin: 0 auto; }

/* Nodos */
.inode {
    position: relative; z-index: 2;
    background: rgba(9, 12, 20, .93);
    border: 1px solid var(--panel-brd); border-radius: 14px;
    padding: .9rem .95rem .95rem; outline: none; cursor: pointer;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
/* Badge 🐧 en los servidores Linux */
.inode--linux::after {
    content: '🐧'; position: absolute; top: .55rem; right: .6rem;
    font-size: .85rem; line-height: 1; opacity: .9;
    filter: drop-shadow(0 0 6px rgba(0,229,255,.5));
}
.inode:hover, .inode:focus-visible, .inode.hot {
    transform: translateY(-3px);
    border-color: rgba(0,229,255,.6);
    box-shadow: 0 10px 34px rgba(0,229,255,.16);
}
.inode__icon { font-size: 1.35rem; line-height: 1; display: block; margin-bottom: .45rem; filter: drop-shadow(0 0 10px rgba(0,229,255,.35)); }
.inode h3 { font-size: .93rem; letter-spacing: .2px; margin-bottom: .1rem; }
.inode p { font-family: var(--mono); font-size: .66rem; color: var(--muted); line-height: 1.5; }
.inode__tags { list-style: none; display: flex; flex-wrap: wrap; gap: .32rem; margin-top: .55rem; }
.inode__tags li {
    font-family: var(--mono); font-size: .62rem; padding: .15rem .48rem; border-radius: 7px;
    background: rgba(120,160,255,.09); border: 1px solid rgba(120,160,255,.16);
    color: #c3cadd; white-space: nowrap;
}

/* Enlaces (SVG) */
.ilink {
    fill: none; stroke-width: 1.4; stroke-linecap: round;
    stroke-dasharray: 5 7; opacity: .75;
    animation: ilink-flow 1.15s linear infinite;
    transition: opacity .25s;
}
.ilink--cyan   { stroke: rgba(0,229,255,.45);  color: var(--cyan); }
.ilink--pink   { stroke: rgba(255,61,166,.5);  color: var(--pink); }
.ilink--violet { stroke: rgba(160,96,255,.5);  color: var(--violet); }
.ilink--green  { stroke: rgba(43,255,136,.4);  color: #2bff88; }
.ilink.hot { opacity: 1; stroke-width: 2.2; filter: drop-shadow(0 0 6px currentColor); }
@keyframes ilink-flow { to { stroke-dashoffset: -24; } }

.ilabel {
    font-family: var(--mono); font-size: 10.5px; fill: var(--muted);
    text-anchor: middle; paint-order: stroke; stroke: #05060a; stroke-width: 4px;
    transition: fill .25s;
}
.ilabel.hot { fill: var(--text); }

.pkt--cyan   { fill: #00e5ff; filter: drop-shadow(0 0 5px #00e5ff); }
.pkt--pink   { fill: #ff3da6; filter: drop-shadow(0 0 5px #ff3da6); }
.pkt--violet { fill: #a060ff; filter: drop-shadow(0 0 5px #a060ff); }

/* Leyenda de flujos */
.infra__flows {
    list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem;
    margin-top: 1.8rem; font-family: var(--mono); font-size: .78rem; color: var(--muted);
}
.infra__flows li { display: inline-flex; align-items: center; gap: .5rem; }
.infra__flows i { width: 22px; height: 3px; border-radius: 999px; display: inline-block; }
.infra__flows .f--cyan   { background: var(--cyan);   box-shadow: 0 0 8px var(--glow-cyan); }
.infra__flows .f--pink   { background: var(--pink);   box-shadow: 0 0 8px rgba(255,61,166,.5); }
.infra__flows .f--violet { background: var(--violet); box-shadow: 0 0 8px rgba(160,96,255,.5); }
.infra__flows .f--green  { background: #2bff88;       box-shadow: 0 0 8px rgba(43,255,136,.5); }

/* Popup de detalle de nodo */
.imodal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.imodal[hidden] { display: none; }
.imodal__overlay {
    position: absolute; inset: 0;
    background: rgba(3, 4, 8, .72); backdrop-filter: blur(4px);
}
.imodal__card {
    position: relative; z-index: 1; width: min(480px, 100%);
    max-height: min(80vh, 560px); overflow-y: auto;
    background: #0a0d16; border: 1px solid rgba(0,229,255,.35); border-radius: 18px;
    padding: 1.8rem 1.7rem 1.6rem;
    box-shadow: 0 24px 80px rgba(0,0,0,.65), 0 0 40px rgba(0,229,255,.12);
    animation: imodal-in .28s ease;
}
@keyframes imodal-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.imodal__close {
    position: absolute; top: .7rem; right: .8rem;
    background: none; border: 1px solid var(--panel-brd); border-radius: 999px;
    width: 34px; height: 34px; color: var(--muted); font-size: 1.25rem; line-height: 1;
    cursor: pointer; transition: color .2s, border-color .2s, box-shadow .2s;
}
.imodal__close:hover { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 12px var(--glow-cyan); }
.imodal__icon { font-size: 2rem; line-height: 1; display: block; margin-bottom: .7rem; filter: drop-shadow(0 0 14px rgba(0,229,255,.45)); }
.imodal__zone {
    display: inline-block; font-family: var(--mono); font-size: .7rem; letter-spacing: .5px;
    padding: .22rem .7rem; border-radius: 999px; margin-bottom: .6rem;
    background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.3); color: var(--cyan);
}
.imodal__card h3 { font-size: 1.35rem; letter-spacing: -.3px; margin-bottom: .55rem; }
.imodal__body { color: #c3cadd; font-size: .97rem; margin-bottom: 1.1rem; }
.imodal__body strong { color: var(--text); }

@media (max-width: 980px) {
    .izone--net .izone__row { grid-template-columns: repeat(3, 1fr); }
    .izone--lan .izone__row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
    .infra { gap: 2.8rem; }
    .izone__row,
    .izone--net .izone__row, .izone--edge .izone__row,
    .izone--dmz .izone__row, .izone--lan .izone__row,
    .izone--lab .izone__row { grid-template-columns: 1fr; gap: 1.6rem; }
    .izone--edge .izone__row, .izone--dmz .izone__row, .izone--lab .izone__row { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .infra__packets { display: none; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
    background: linear-gradient(var(--cyan), var(--violet), transparent);
}
.tl-item { position: relative; padding-bottom: 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute; left: -2rem; top: 6px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 12px var(--glow-cyan);
}
.tl-content { background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 14px; padding: 1.4rem 1.6rem; backdrop-filter: blur(8px); }
.tl-date { font-family: var(--mono); font-size: .8rem; color: var(--cyan); }
.tl-content h3 { font-size: 1.2rem; margin: .35rem 0 .6rem; }
.tl-content p { color: var(--muted); }
.tl-bullets { margin: .8rem 0 0 1.1rem; color: #c3cadd; font-size: .95rem; }
.tl-bullets li { margin-bottom: .3rem; }

/* ---------- Contacto ---------- */
.section--contact { text-align: center; }
.contact__title { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 700; margin: .8rem 0 .6rem; letter-spacing: -1px; }
.contact__sub { color: var(--muted); margin-bottom: 2rem; font-size: 1.1rem; }
.contact__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.contact__socials { display: flex; gap: 1.8rem; justify-content: center; margin-top: 2.2rem; font-family: var(--mono); font-size: .9rem; }
.contact__socials a { color: var(--muted); transition: color .2s, text-shadow .2s; }
.contact__socials a:hover { color: var(--cyan); text-shadow: 0 0 10px var(--glow-cyan); }

/* ---------- Mapa de visitas ---------- */
.visitmap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; align-items: center; }
.visitmap__map {
    width: 100%; height: 420px;
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 16px;
    padding: .5rem; backdrop-filter: blur(8px);
}
.visitmap__map svg { width: 100%; height: 100%; }
.visitmap__list { list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.visitmap__list li { display: grid; grid-template-columns: auto 1fr 80px auto; align-items: center; gap: .7rem; font-size: .92rem; }
.visitmap__list .flag { font-size: 1.3rem; line-height: 1; }
.visitmap__list .cname { color: #c3cadd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visitmap__list .cbar { height: 8px; border-radius: 999px; background: rgba(120,160,255,.1); overflow: hidden; }
.visitmap__list .cbar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); box-shadow: 0 0 10px var(--glow-cyan); }
.visitmap__list .cnum { font-family: var(--mono); color: var(--cyan); font-weight: 600; text-align: right; }

@media (max-width: 820px) {
    .visitmap { grid-template-columns: 1fr; }
    .visitmap__map { height: 300px; }
}

/* ---------- Sesión en vivo (IP + ubicación por WebSocket) ---------- */
.session { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; align-items: stretch; }
.session__panel {
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 16px;
    padding: 1.6rem; backdrop-filter: blur(8px);
    display: flex; flex-direction: column; gap: 1.2rem;
}
.session__status {
    display: inline-flex; align-items: center; gap: .55rem; align-self: flex-start;
    font-family: var(--mono); font-size: .78rem; color: var(--muted);
    border: 1px solid var(--panel-brd); border-radius: 999px; padding: .38rem .8rem;
}
.session__status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.session__status.live { color: #2ee66e; border-color: rgba(46,230,110,.4); }
.session__status.live .dot { background: #2ee66e; box-shadow: 0 0 8px rgba(46,230,110,.65); animation: sess-pulse 1.6s infinite; }
.session__status.err { color: #ff4d4d; border-color: rgba(255,77,77,.45); }
.session__status.err .dot { background: #ff4d4d; box-shadow: 0 0 8px rgba(255,77,77,.55); }
@keyframes sess-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.session__data { list-style: none; display: flex; flex-direction: column; gap: .8rem; }
.session__data li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    border-bottom: 1px dashed var(--panel-brd); padding-bottom: .7rem;
}
.session__data li:last-child { border-bottom: 0; padding-bottom: 0; }
.session__data span { color: var(--muted); font-size: .82rem; font-family: var(--mono); }
.session__data b { color: var(--text); font-family: var(--mono); font-size: 1rem; text-align: right; word-break: break-all; }
.session__data b[data-session-ip] { color: var(--cyan); text-shadow: 0 0 10px var(--glow-cyan); font-size: 1.15rem; }
.session__note { color: var(--muted); font-size: .77rem; line-height: 1.6; margin-top: auto; }
.session__note code { font-family: var(--mono); color: var(--pink); }

.session__map {
    width: 100%; height: 440px;
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 16px;
    padding: .5rem; backdrop-filter: blur(8px);
}
.session__map svg { width: 100%; height: 100%; }
/* marcador neón de tu ubicación */
.session__map .jvm-marker { fill: var(--pink); filter: drop-shadow(0 0 6px var(--pink)); }

@media (max-width: 820px) {
    .session { grid-template-columns: 1fr; }
    .session__map { height: 320px; }
}

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 2.5rem 1rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--panel-brd); font-family: var(--mono); }
.footer__counter {
    display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .9rem;
    padding: .4rem 1rem; border: 1px solid var(--panel-brd); border-radius: 999px;
    background: var(--panel); color: var(--cyan);
}
.footer__counter[data-visits] b, .footer__counter span[data-visits] { color: var(--cyan); font-weight: 600; }
.footer__counter-icon { filter: drop-shadow(0 0 6px var(--glow-cyan)); }

/* ---------- Animaciones reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.5);opacity:.5} }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
/* Overlay del menú móvil (oculto en escritorio) */
.nav__overlay {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(3, 4, 8, .6); backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.nav__overlay.open { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }

@media (max-width: 820px) {
    .about { grid-template-columns: 1fr; }
    .nav { padding: .85rem 1.2rem; }
    .nav__links {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 55;
        width: min(80vw, 300px);
        flex-direction: column; justify-content: center; align-items: stretch; gap: .4rem;
        padding: 5.5rem 1.6rem 2rem;
        background: #0a0d16; border-left: 1px solid var(--panel-brd);
        box-shadow: -24px 0 60px rgba(0, 0, 0, .6);
        transform: translateX(100%); transition: transform .35s ease;
    }
    .nav__links.open { transform: none; }
    .nav__links a {
        font-size: 1.1rem; padding: .85rem 1rem; border-radius: 12px;
        color: var(--text); transition: background .2s, color .2s;
    }
    .nav__links a:not(.nav__cta) { border-bottom: 1px solid rgba(255,255,255,.05); border-radius: 0; }
    .nav__links a:active, .nav__links a:hover { background: rgba(120,160,255,.08); }
    .nav__links a:not(.nav__cta)::after { display: none; }
    .nav__cta { text-align: center; margin-top: 1rem; border-color: var(--cyan); }
    .nav__burger { display: flex; z-index: 60; }
    .nav__burger.open span { background: var(--cyan); }
    .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav__burger.open span:nth-child(2) { opacity: 0; }
    .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ===========================================================
   Chat flotante con IA (Nemotron)
   =========================================================== */
.chatw { position: fixed; left: 22px; right: auto; bottom: 30px; z-index: 90; }

.chatw__fab {
    width: 55px; height: 55px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--grad); color: #05060a; display: grid; place-items: center;
    font-size: 1.6rem; line-height: 1;
    box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 18px var(--glow-cyan);
    transition: transform .2s, box-shadow .2s;
}
.chatw__fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 24px var(--glow-cyan); }
.chatw__fab-close { display: none; }
.chatw.open .chatw__fab-open { display: none; }
.chatw.open .chatw__fab-close { display: block; }

.chatw__panel {
    position: absolute; left: 0; right: auto; bottom: 76px;
    width: 380px; max-width: calc(100vw - 44px);
    height: 560px; max-height: calc(100vh - 130px);
    background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 18px;
    backdrop-filter: blur(14px); overflow: hidden; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.chatw.open .chatw__panel { opacity: 1; transform: none; pointer-events: auto; }

.chat__bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1rem; border-bottom: 1px solid var(--panel-brd); background: rgba(0,229,255,.05);
}
.chat__id { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .9rem; color: var(--cyan); }
.chat__id .dot { width: 8px; height: 8px; }
.chatw.is-off .chat__id { color: #ff4d4d; }
.chatw__close { background: none; border: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: .2rem .4rem; border-radius: 8px; }
.chatw__close:hover { color: var(--text); background: rgba(255,255,255,.06); }

.chat__log { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; overflow-y: auto; }
.chat__msg { display: flex; }
.chat__msg--user { justify-content: flex-end; }
.chat__bubble {
    max-width: 82%; padding: .65rem .9rem; border-radius: 14px; font-size: .92rem; line-height: 1.5;
    word-wrap: break-word; overflow-wrap: anywhere;
}
.chat__msg--ai .chat__bubble { background: rgba(120,160,255,.08); border: 1px solid var(--panel-brd); color: var(--text); border-top-left-radius: 4px; }
.chat__msg--user .chat__bubble { background: linear-gradient(110deg, rgba(0,229,255,.18), rgba(160,96,255,.18)); border: 1px solid rgba(0,229,255,.3); color: var(--text); border-top-right-radius: 4px; }
.chat__bubble code { font-family: var(--mono); background: rgba(255,61,166,.12); color: var(--pink); padding: .1em .35em; border-radius: 5px; font-size: .88em; }
.chat__bubble pre { background: var(--bg-soft); border: 1px solid var(--panel-brd); border-radius: 10px; padding: .6rem .7rem; overflow-x: auto; margin: .4rem 0; }
.chat__bubble pre code { background: none; color: var(--text); padding: 0; }
.chat__bubble strong { color: var(--cyan); }
.chat__bubble a { color: var(--cyan); text-decoration: underline; }
.chat__tablewrap { overflow-x: auto; max-width: 100%; margin: .5rem 0; border: 1px solid var(--panel-brd); border-radius: 10px; -webkit-overflow-scrolling: touch; }
.chat__table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.chat__table th, .chat__table td { border: 1px solid var(--panel-brd); padding: .4rem .6rem; text-align: left; white-space: nowrap; }
.chat__table thead th { background: rgba(0,229,255,.08); color: var(--cyan); font-weight: 600; }
.chat__table tbody tr:nth-child(even) { background: rgba(120,160,255,.04); }
.chat__cursor { display: inline-block; width: .5ch; color: var(--cyan); animation: blink 1s steps(2) infinite; }

.chat__form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--panel-brd); }
.chat__input {
    flex: 1 1 auto; min-width: 0; width: 100%; resize: none; max-height: 120px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--panel-brd); border-radius: 12px; padding: .6rem .8rem;
    font-family: var(--font); font-size: 16px; outline: none; line-height: 1.4;
}
.chat__input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(0,229,255,.15); }
.chat__send {
    flex: none; width: 44px; border: none; border-radius: 12px; cursor: pointer; color: #05060a;
    background: var(--grad); font-size: 1rem; transition: transform .15s, box-shadow .2s, opacity .2s;
}
.chat__send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 16px var(--glow-cyan); }
.chat__send:disabled { opacity: .45; cursor: not-allowed; }

/* Móvil: al abrir, ocupa toda la pantalla y sigue al viewport visible
   (así no se mueve ni se pierde cuando aparece el teclado). */
@media (max-width: 560px) {
    .chatw { left: 16px; right: auto; bottom: 16px; }
    .chatw.open .chatw__panel {
        position: fixed; bottom: auto; right: auto;
        top: var(--vv-top, 0px);
        left: var(--vv-left, 0px);
        width: var(--vv-width, 100%);
        max-width: none;
        height: var(--vvh, 100dvh); max-height: none;
        border-radius: 0; border: none;
    }
    .chatw.open .chatw__fab { display: none; }
}
/* Bloqueo del fondo mientras el chat está abierto (evita que la página haga scroll) */
body.chat-open { position: fixed; width: 100%; overflow: hidden; }
