/* ==========================================================================
   Victor Verjano · Portfolio
   ========================================================================== */

:root {
  --bg: #05080f;
  --bg-2: #070c17;
  --panel: rgba(11, 19, 36, .66);
  --panel-solid: #0b1324;
  --line: rgba(148, 163, 184, .13);
  --line-2: rgba(148, 163, 184, .24);
  --text: #e6edf6;
  --muted: #9aa8bd;
  --dim: #6b7a90;
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(110deg, #22d3ee 0%, #60a5fa 45%, #a78bfa 100%);

  --radius: 18px;
  --container: 1180px;
  --nav-h: 64px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --z-content: 2;
  --z-glow: 1;
  --z-nav: 50;
  --z-toast: 70;
  --z-matrix: 90;
  --z-boot: 100;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
html.booting { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* Suelo técnico de CPD: rejilla sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: rgba(34, 211, 238, .3); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--font-mono); font-size: .9em; padding: .1em .4em; border-radius: 6px; background: rgba(34, 211, 238, .1); color: #a5f3fc; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: calc(var(--z-boot) + 1);
  padding: 10px 16px; border-radius: 10px; background: var(--cyan); color: #021018; font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

.container { position: relative; width: min(var(--container), 100% - 48px); margin-inline: auto; }
main, .footer { position: relative; z-index: var(--z-content); }

/* ---------- Boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: var(--z-boot);
  display: none; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
  transition: opacity .5s ease, visibility .5s ease;
}
.booting .boot { display: flex; animation: boot-failsafe .3s 3s forwards; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(640px, 100%); }
.boot-log { font: 400 .92rem/1.9 var(--font-mono); color: #a9b8cc; min-height: 12em; }
.boot-log .ok { color: var(--green); }
.boot-log .dim { color: var(--dim); }
.boot-log div { animation: boot-line .25s ease-out both; }
.boot-skip { margin-top: 24px; font: 400 .78rem var(--font-mono); color: var(--dim); animation: blink 1.4s steps(1) infinite; }
@keyframes boot-line { from { opacity: 0; transform: translateX(-6px); } }
@keyframes boot-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Progreso y brillo del cursor ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: calc(var(--z-nav) + 1);
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
  box-shadow: 0 0 12px rgba(34, 211, 238, .7);
}
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: var(--z-glow);
  width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .075), transparent);
  pointer-events: none; opacity: 0; transition: opacity .4s;
  transform: translate3d(-999px, -999px, 0);
  will-change: transform;
}
.cursor-glow.on { opacity: 1; }
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Botones ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px; border-radius: 12px;
  font: 600 .96rem/1 var(--font-sans); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .35s var(--ease-out), box-shadow .25s, background-color .25s, border-color .25s, color .25s;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary { color: #021018; background: var(--grad); box-shadow: 0 10px 30px -10px rgba(34, 211, 238, .6); }
.btn-primary:hover { box-shadow: 0 14px 44px -8px rgba(34, 211, 238, .8); }
.btn-ghost { color: var(--text); background: rgba(148, 163, 184, .06); border-color: var(--line-2); }
.btn-ghost:hover { border-color: rgba(34, 211, 238, .55); background: rgba(34, 211, 238, .08); }
.btn-sm { --h: 40px; padding: 0 14px; font-size: .88rem; border-radius: 10px; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: var(--z-nav);
  width: min(var(--container) + 24px, 100% - 24px); height: var(--nav-h);
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 12px 0 14px; border-radius: 16px; border: 1px solid transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s;
}
/* Fondo casi opaco en vez de backdrop-filter: el desenfoque sobre el canvas animado se recalculaba en cada fotograma */
.nav.scrolled, .nav.open {
  background: rgba(7, 12, 23, .93);
  border-color: var(--line);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .8);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 500 .95rem var(--font-mono); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font: 700 .95rem var(--font-display); color: var(--cyan);
  background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(167, 139, 250, .16));
  border: 1px solid rgba(34, 211, 238, .35);
  box-shadow: inset 0 0 12px rgba(34, 211, 238, .15);
}
.brand .host { color: var(--dim); }
.brand-caret { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
.nav-links { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  position: relative; display: block; padding: 9px 13px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); background: rgba(148, 163, 184, .08); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 2px; border-radius: 2px;
  background: var(--grad); box-shadow: 0 0 10px rgba(34, 211, 238, .8);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn {
  display: none; width: 44px; height: 44px; place-items: center; border-radius: 10px;
  background: rgba(148, 163, 184, .08); border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
}
.menu-btn .ic-close { display: none; }
.nav.open .menu-btn .ic-open { display: none; }
.nav.open .menu-btn .ic-close { display: block; }

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: 10px;
    background: rgba(7, 12, 23, .98); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .9);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .3s var(--ease-out), visibility .25s;
  }
  .nav.open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 13px 14px; font-size: 1rem; }
  .nav-links a.active::after { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
}
@media (max-width: 420px) { .brand-text { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; padding: 130px 0 110px; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 180px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}
/* Manchas de luz con degradados radiales (ya difuminados) en vez de filter: blur(),
   que obligaba a recalcular el desenfoque en cada fotograma. Solo se anima transform. */
.aurora { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aurora span { position: absolute; border-radius: 50%; will-change: transform; animation: drift 22s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 780px; height: 780px; top: -300px; right: -260px; background: radial-gradient(closest-side, rgba(34, 211, 238, .15), transparent); }
.aurora span:nth-child(2) { width: 700px; height: 700px; bottom: -320px; left: -280px; background: radial-gradient(closest-side, rgba(167, 139, 250, .13), transparent); animation-delay: -8s; }
.aurora span:nth-child(3) { width: 520px; height: 520px; top: 32%; left: 38%; background: radial-gradient(closest-side, rgba(96, 165, 250, .08), transparent); animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(60px, -40px, 0) scale(1.12); } }

.hero-grid { z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, .32); background: rgba(52, 211, 153, .08);
  color: #b4f3da; font: 500 .84rem var(--font-mono);
}
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero-title {
  margin: 24px 0 18px;
  font: 700 clamp(2.6rem, 6.4vw, 5.1rem)/1.02 var(--font-display);
  letter-spacing: -.035em;
}
/* Altura fija + contención: el texto que se escribe solo no recalcula el layout del resto del hero */
.typed-line { margin: 0; height: 1.6em; contain: size layout style; font: 500 clamp(.98rem, 1.9vw, 1.2rem)/1.5 var(--font-mono); color: var(--cyan); }
.typed-line .prompt { color: var(--green); margin-right: 6px; }
.caret { display: inline-block; width: .55ch; height: 1.1em; margin-left: 3px; vertical-align: -.18em; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { max-width: 56ch; margin: 20px 0 34px; color: var(--muted); font-size: clamp(1.04rem, 1.4vw, 1.16rem); }
.lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 38px 0 0; padding: 0; list-style: none; color: var(--dim); font: 500 .84rem var(--font-mono); }
.hero-meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .ic { width: 16px; height: 16px; color: var(--cyan); }

/* Entrada escalonada del hero */
.js .hero-in { opacity: 0; translate: 0 26px; }
.js.ready .hero-in { animation: hero-in .75s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes hero-in { to { opacity: 1; translate: 0 0; } }

/* Retrato con anillo de "fibra" */
.hero-visual { justify-self: center; }
.avatar-wrap { position: relative; width: min(420px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.orbit { position: absolute; inset: 2%; border-radius: 50%; border: 1px dashed rgba(148, 163, 184, .22); animation: spin 38s linear infinite; }
.orbit.o2 { inset: -7%; border: 1px solid rgba(148, 163, 184, .08); animation-duration: 56s; animation-direction: reverse; }
.orbit i { position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px 2px var(--cyan); }
.orbit.o2 i { top: auto; left: 13%; bottom: 13%; background: var(--violet); box-shadow: 0 0 16px 2px var(--violet); }
.avatar { position: relative; width: 72%; aspect-ratio: 1; border-radius: 50%; padding: 5px; isolation: isolate; }
.avatar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 50%, rgba(34, 211, 238, .9) 72%, var(--violet) 88%, transparent 100%);
  animation: spin 4.5s linear infinite;
}
.avatar::after {
  content: ""; position: absolute; inset: -18%; z-index: -2; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .28), transparent 70%);
  animation: breathe 5s ease-in-out infinite;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; border: 5px solid var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .7; } }

.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 12px;
  background: rgba(10, 17, 32, .94); border: 1px solid var(--line-2);
  font: 500 .8rem var(--font-mono); color: var(--text); white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8);
  animation: float 6s ease-in-out infinite;
}
.chip .ic { width: 16px; height: 16px; color: var(--cyan); }
.chip.c1 { top: 8%; left: -6%; }
.chip.c2 { top: 22%; right: -10%; animation-delay: -1.5s; }
.chip.c3 { bottom: 18%; left: -12%; animation-delay: -3s; }
.chip.c4 { bottom: 4%; right: 2%; animation-delay: -4.5s; }
@keyframes float { 50% { transform: translateY(-12px); } }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; z-index: 1; translate: -50% 0;
  width: 26px; height: 42px; border-radius: 14px; border: 2px solid rgba(148, 163, 184, .35);
}
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: var(--z-content); overflow: hidden; padding: 20px 0;
  border-block: 1px solid var(--line); background: rgba(7, 12, 23, .7);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 44px; padding-right: 44px; }
.marquee-group span { display: inline-flex; align-items: center; gap: 44px; font: 500 1rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.marquee-group span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Secciones ---------- */
.section { position: relative; padding: 130px 0; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(11, 19, 36, .45) 18%, rgba(11, 19, 36, .45) 82%, transparent); }
.section-head { max-width: 760px; margin-bottom: 60px; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0; font: 500 .86rem var(--font-mono); color: var(--cyan); letter-spacing: .03em; }
.kicker::before { content: ""; width: 30px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.section-head.center .kicker::after { content: ""; width: 30px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.section-title { margin: 16px 0 18px; font: 700 clamp(2.05rem, 4.4vw, 3.4rem)/1.06 var(--font-display); letter-spacing: -.03em; }
.section-sub { margin: 0; color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.section-head.center .section-sub { margin-inline: auto; }

/* Aparición al hacer scroll */
.js [data-reveal] { opacity: 0; translate: 0 34px; transition: opacity .9s var(--ease-out), translate .9s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-reveal].is-visible { opacity: 1; translate: 0 0; }

/* Brillo que sigue al ratón */
[data-spot] { position: relative; }
[data-spot]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, .11), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
[data-spot]:hover::before { opacity: 1; }
[data-spot] > * { position: relative; z-index: 1; }

[data-tilt] { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
[data-tilt], .js [data-reveal][data-tilt] {
  transition: transform .5s var(--ease-out), border-color .3s, box-shadow .3s, opacity .9s var(--ease-out), translate .9s var(--ease-out);
  transition-delay: 0s, 0s, 0s, var(--d, 0s), var(--d, 0s);
}

/* ---------- Sobre mí ---------- */
.about-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 56px; align-items: start; }
.about-text p { margin: 0 0 18px; color: var(--muted); font-size: 1.07rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 34px 0 0; }
.stat {
  padding: 22px 22px 20px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 26, 48, .75), rgba(11, 19, 36, .45));
  border: 1px solid var(--line);
}
.stat dd { margin: 0; }
.stat b { display: block; font: 700 clamp(1.9rem, 3.4vw, 2.5rem)/1 var(--font-display); letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.window {
  border-radius: 16px; overflow: hidden;
  background: #060b16; border: 1px solid var(--line-2);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(34, 211, 238, .04), 0 0 60px -30px rgba(34, 211, 238, .35);
}
.window-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(15, 23, 42, .7); }
.window-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-bar i:nth-child(2) { background: #febc2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-title { margin-left: 10px; font: 500 .8rem var(--font-mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { margin: 0; padding: 22px 22px 26px; font: 400 .87rem/1.8 var(--font-mono); color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
.code code { padding: 0; background: none; color: inherit; font-size: inherit; }
.code .k { color: #7dd3fc; }
.code .s { color: #86efac; }
.code .n { color: #fbbf24; }
.code .p { color: #7b8aa3; }
.code-caret { display: inline-block; width: .55ch; height: 1.1em; margin-left: 4px; vertical-align: -.2em; background: var(--cyan); animation: blink 1s steps(1) infinite; }

/* ---------- Tarjetas "Qué hago" ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 30px 28px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
.card:hover { border-color: rgba(34, 211, 238, .38); box-shadow: 0 30px 60px -30px rgba(34, 211, 238, .35); }
.card-icon {
  width: 48px; height: 48px; flex: none; border-radius: 13px; display: grid; place-items: center;
  color: var(--cyan); background: rgba(34, 211, 238, .09); border: 1px solid rgba(34, 211, 238, .25);
  box-shadow: inset 0 0 14px rgba(34, 211, 238, .12);
}
.card-icon .ic { width: 22px; height: 22px; }
.card .card-icon { margin-bottom: 22px; }
.card h3 { margin: 0 0 10px; font: 600 1.22rem/1.3 var(--font-display); }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; --p: 0; }
.timeline::before, .timeline-fill {
  content: ""; position: absolute; left: 23px; top: 10px; width: 2px; height: calc(100% - 20px); border-radius: 2px;
}
.timeline::before { background: var(--line); }
.timeline-fill {
  background: linear-gradient(var(--cyan), var(--blue) 50%, var(--violet));
  box-shadow: 0 0 14px rgba(34, 211, 238, .8);
  transform-origin: top; transform: scaleY(var(--p));
}
.tl-list { margin: 0; padding: 0; list-style: none; }
.tl-item { position: relative; padding-left: 72px; margin-bottom: 26px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-node {
  position: absolute; left: 12px; top: 30px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); border: 2px solid var(--line-2);
  transition: border-color .5s, box-shadow .5s;
}
.tl-node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: background-color .5s, box-shadow .5s; }
.tl-item.is-active .tl-node { border-color: var(--cyan); box-shadow: 0 0 0 6px rgba(34, 211, 238, .1), 0 0 22px rgba(34, 211, 238, .55); }
.tl-item.is-active .tl-node::after { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.tl-card {
  padding: 28px 30px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .3s, box-shadow .3s;
}
.tl-card:hover { border-color: rgba(34, 211, 238, .32); }
.tl-card.is-current { border-color: transparent; background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, linear-gradient(120deg, rgba(34, 211, 238, .8), rgba(96, 165, 250, .3), rgba(167, 139, 250, .8)) border-box; box-shadow: 0 30px 70px -35px rgba(34, 211, 238, .45); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 18px; }
.tl-role { margin: 0; font: 600 1.26rem/1.3 var(--font-display); }
.tl-company { margin: 5px 0 0; font-weight: 600; color: var(--cyan); }
.tl-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-date { display: inline-block; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(148, 163, 184, .05); font: 500 .8rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 16px; color: var(--dim); font-size: .9rem; }
.tl-meta span { display: inline-flex; align-items: center; gap: 8px; }
.tl-meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.tl-card ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.tl-card li { position: relative; padding-left: 24px; color: var(--muted); }
.tl-card li::before { content: ""; position: absolute; left: 0; top: .78em; width: 12px; height: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, .7); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { padding: 5px 11px; border-radius: 999px; font: 500 .76rem var(--font-mono); color: #c7ddff; background: rgba(96, 165, 250, .08); border: 1px solid rgba(96, 165, 250, .22); }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; font: 600 .74rem var(--font-mono); letter-spacing: .03em; text-transform: uppercase; }
.badge-live { color: #b4f3da; background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .35); }
.badge-intern { color: #ddd6fe; background: rgba(167, 139, 250, .1); border: 1px solid rgba(167, 139, 250, .3); }
.badge-main { color: #a5f3fc; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .35); }

/* ---------- Formación ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.edu-card {
  grid-column: span 2; overflow: hidden;
  padding: 28px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
.edu-card.featured { grid-column: span 3; background: linear-gradient(160deg, rgba(34, 211, 238, .08), rgba(11, 19, 36, .7) 45%); }
.edu-card:hover { border-color: rgba(34, 211, 238, .38); box-shadow: 0 30px 60px -30px rgba(34, 211, 238, .35); }
.edu-watermark {
  position: absolute !important; right: -6px; bottom: -22px; z-index: 0 !important;
  font: 700 6.2rem/1 var(--font-display); letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(148, 163, 184, .12);
  pointer-events: none; user-select: none;
}
.edu-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.edu-level { margin: 0 0 6px; font: 500 .8rem var(--font-mono); color: var(--cyan); text-transform: uppercase; letter-spacing: .06em; }
.edu-card h3 { margin: 0 0 8px; font: 600 1.18rem/1.32 var(--font-display); }
.edu-card.featured h3 { font-size: 1.36rem; }
.edu-school { margin: 0; color: var(--muted); }

/* ---------- Habilidades: rack ---------- */
.skills-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 40px; align-items: start; }
.rack {
  position: relative; padding: 18px 34px 22px; border-radius: 14px;
  background: linear-gradient(180deg, #0e1628, #080d19);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 5px #0a111f, inset 0 0 40px rgba(0, 0, 0, .7), 0 50px 90px -40px rgba(0, 0, 0, 1);
}
.rack::before, .rack::after {
  content: ""; position: absolute; top: 46px; bottom: 16px; width: 12px;
  background:
    radial-gradient(circle at 50% 7px, #060a14 2.5px, transparent 3px) 0 0 / 12px 18px,
    linear-gradient(#1a2440, #141c33);
  border-radius: 3px;
}
.rack::before { left: 12px; }
.rack::after { right: 12px; }
.rack-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font: 500 .74rem var(--font-mono); color: var(--dim); letter-spacing: .08em; }
.rack-status { display: inline-flex; align-items: center; gap: 8px; color: var(--green); }
.rack-units { display: grid; gap: 8px; }
.unit {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 6px;
  background: linear-gradient(180deg, #18233a, #0f1829);
  border: 1px solid #22314f; color: var(--text);
  font: 500 .84rem var(--font-mono); letter-spacing: .08em; text-align: left; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .45s var(--ease-out), border-color .25s, box-shadow .3s, background-color .25s;
}
.unit:hover { transform: translateX(4px); border-color: rgba(34, 211, 238, .45); }
.unit[aria-pressed="true"] {
  transform: translateX(8px);
  border-color: var(--cyan);
  background: linear-gradient(180deg, #1b2a45, #122036);
  box-shadow: -10px 0 28px -8px rgba(34, 211, 238, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.unit[aria-pressed="true"] .unit-name { color: var(--cyan); text-shadow: 0 0 12px rgba(34, 211, 238, .6); }
.leds { display: flex; gap: 6px; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: led var(--t, 1.4s) steps(1) infinite; animation-delay: var(--dl, 0s); }
.led.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
@keyframes led { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }
.vent { width: 76px; height: 16px; border-radius: 3px; background: repeating-linear-gradient(90deg, #070c18 0 3px, transparent 3px 6px); opacity: .9; }

.console { position: sticky; top: 100px; }
.console-body { min-height: 360px; padding: 22px 24px 26px; font-family: var(--font-mono); }
.console-cmd { margin: 0 0 18px; color: #cbd5e1; font-size: .9rem; }
.console-cmd .prompt { color: var(--green); margin-right: 6px; }
.console-unit { color: var(--cyan); }
.unit-detail h3 { margin: 0 0 6px; font: 600 1.28rem var(--font-display); color: var(--text); }
.unit-detail h3::after { content: "● active (running)"; display: block; margin-top: 6px; font: 500 .8rem var(--font-mono); color: var(--green); }
.unit-detail ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.unit-detail li { display: flex; gap: 12px; color: #cbd5e1; font-size: .92rem; line-height: 1.5; }
.unit-detail li::before { content: "[ OK ]"; color: var(--green); flex: none; white-space: pre; }
.js .unit-detail { display: none; }
.js .unit-detail.is-active { display: block; }
.js .unit-detail.is-active li { animation: line-in .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
@keyframes line-in { from { opacity: 0; transform: translateX(-10px); } }

.extras { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; margin-top: 44px; }
.extra-card { padding: 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.extra-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 600 1.08rem var(--font-display); }
.extra-card h3 .ic { color: var(--cyan); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pills li { padding: 7px 13px; border-radius: 999px; font-size: .88rem; color: var(--text); background: rgba(148, 163, 184, .07); border: 1px solid var(--line-2); transition: border-color .25s, background-color .25s, color .25s; }
.pills li:hover { border-color: rgba(34, 211, 238, .5); background: rgba(34, 211, 238, .08); color: #a5f3fc; }
.lang + .lang { margin-top: 16px; }
.lang-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 500; }
.lang-level { font: 500 .8rem var(--font-mono); color: var(--muted); }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.bars i { height: 8px; border-radius: 3px; background: rgba(148, 163, 184, .12); }
.bars i:nth-child(-n + 5) { transition: background-color .5s, box-shadow .5s; }
.is-visible .bars i:nth-child(1), .is-visible .bars[style*="--n:2"] i:nth-child(-n+2), .is-visible .bars[style*="--n:3"] i:nth-child(-n+3), .is-visible .bars[style*="--n:4"] i:nth-child(-n+4), .is-visible .bars[style*="--n:5"] i { background: var(--cyan); box-shadow: 0 0 10px rgba(34, 211, 238, .5); }
.bars i:nth-child(2) { transition-delay: .1s; } .bars i:nth-child(3) { transition-delay: .2s; } .bars i:nth-child(4) { transition-delay: .3s; } .bars i:nth-child(5) { transition-delay: .4s; }
.checks { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checks .ic { width: 18px; height: 18px; color: var(--green); }

/* ---------- Terminal ---------- */
.term { max-width: 920px; margin-inline: auto; }
.term-body { height: 440px; overflow-y: auto; padding: 18px 22px 22px; font: 400 .9rem/1.7 var(--font-mono); color: #cbd5e1; cursor: text; scrollbar-width: thin; scrollbar-color: #22314f transparent; }
.term-out > div { white-space: pre-wrap; word-break: break-word; }
.term-out .t-cmd { color: var(--text); margin-top: 8px; }
.term-out .t-dim { color: var(--dim); }
.term-out .t-ok { color: var(--green); }
.term-out .t-err { color: var(--red); }
.term-out .t-acc { color: var(--cyan); }
.term-out .t-vio { color: var(--violet); }
.term-out .t-amb { color: var(--amber); }
.term-out a { color: var(--cyan); }
.term-out .t-grid { display: grid; grid-template-columns: 150px 1fr; gap: 0 16px; }
.term-prompt, .term-out .u { color: var(--green); }
.term-out .d, .term-prompt .d { color: var(--blue); }
.neo { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 6px 0; }
.neo pre { margin: 0; font: inherit; line-height: 1; letter-spacing: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.neo .swatches { display: flex; gap: 4px; margin-top: 8px; }
.neo .swatches i { width: 22px; height: 12px; border-radius: 2px; }
.term-form { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.term-prompt { flex: none; }
.term-form input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; caret-color: var(--cyan); }
.term-hints { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; font: 500 .82rem var(--font-mono); color: var(--dim); }
.term-hints button {
  min-height: 36px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  font: inherit; color: var(--muted); background: rgba(148, 163, 184, .06); border: 1px solid var(--line-2);
  transition: color .2s, border-color .2s, background-color .2s;
}
.term-hints button:hover { color: #a5f3fc; border-color: rgba(34, 211, 238, .5); background: rgba(34, 211, 238, .08); }

/* ---------- Contacto ---------- */
.contact-card {
  overflow: hidden; text-align: center;
  padding: clamp(40px, 7vw, 84px) clamp(20px, 5vw, 64px);
  border-radius: 28px; border: 1px solid var(--line-2);
  background: radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, .12), transparent 60%), rgba(9, 15, 29, .8);
}
.contact-glow { position: absolute !important; inset: auto -20% -60% -20%; height: 120%; z-index: 0 !important; background: radial-gradient(closest-side at 30% 50%, rgba(34, 211, 238, .16), transparent), radial-gradient(closest-side at 70% 50%, rgba(167, 139, 250, .16), transparent); will-change: transform; animation: spin 30s linear infinite; pointer-events: none; }
.contact-card .kicker::after { content: ""; width: 30px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.contact-title { margin: 18px 0 16px; font: 700 clamp(2.8rem, 8vw, 5.6rem)/1 var(--font-display); letter-spacing: -.04em; }
.contact-card .section-sub { margin-inline: auto; }
.contact-actions { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .85fr); gap: 14px; margin: 44px 0 36px; text-align: left; }
.contact-tile {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 18px; border-radius: 16px; background: rgba(7, 12, 23, .7); border: 1px solid var(--line);
  transition: border-color .25s;
}
.contact-tile:hover { border-color: rgba(34, 211, 238, .4); }
.contact-tile > div { min-width: 0; flex: 1; }
.tile-label { display: block; font: 500 .74rem var(--font-mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.tile-value { display: block; margin-top: 2px; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.tile-value:hover { color: var(--cyan); }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  color: var(--muted); background: rgba(148, 163, 184, .06); border: 1px solid var(--line-2);
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--cyan); border-color: rgba(34, 211, 238, .5); background: rgba(34, 211, 238, .08); }
.icon-btn .ic { width: 18px; height: 18px; }
.contact-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Footer ---------- */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; color: var(--dim); font-size: .88rem; }
.footer p { margin: 0; }
.footer-mono { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .8rem; }
.footer-mono .ic { width: 15px; height: 15px; color: var(--cyan); }
#uptime { color: var(--green); font-variant-numeric: tabular-nums; }

/* ---------- Flotantes ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-nav);
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  color: var(--text); background: rgba(10, 17, 32, .94); border: 1px solid var(--line-2);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, transform .4s var(--ease-out), visibility .3s, border-color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: rgba(34, 211, 238, .55); color: var(--cyan); }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: var(--z-toast);
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  font: 500 .88rem var(--font-mono); color: #b4f3da;
  background: rgba(7, 12, 23, .95); border: 1px solid rgba(52, 211, 153, .4);
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .9);
  opacity: 0; visibility: hidden; transform: translate(-50%, 16px);
  transition: opacity .3s, transform .4s var(--ease-out), visibility .3s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.matrix { position: fixed; inset: 0; z-index: var(--z-matrix); background: #000; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; cursor: pointer; }
.matrix.on { opacity: 1; visibility: visible; }
.matrix canvas { width: 100%; height: 100%; }
.matrix p { position: absolute; left: 0; right: 0; bottom: 28px; margin: 0; text-align: center; font: 500 .9rem var(--font-mono); color: #86efac; text-shadow: 0 0 10px #22c55e; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .typed-line { height: 3em; }
  .chip.c2 { right: -3%; }
  .chip.c3 { left: -6%; }
}
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .edu-card, .edu-card.featured { grid-column: span 3; }
  .edu-grid > .edu-card:last-child { grid-column: 1 / -1; }
  .extras { grid-template-columns: 1fr 1fr; }
  .extras > :first-child { grid-column: 1 / -1; }
  .contact-actions { grid-template-columns: 1fr 1fr; }
  .contact-actions > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .hero { padding-top: 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; text-align: left; }
  .hero-visual { order: -1; }
  .avatar-wrap { width: min(300px, 70vw); }
  .about-grid, .skills-grid { grid-template-columns: 1fr; }
  .console { position: static; }
  .section { padding: 100px 0; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .section { padding: 84px 0; }
  .section-head { margin-bottom: 44px; }
  .cards, .edu-grid, .extras, .contact-actions { grid-template-columns: 1fr; }
  .edu-card, .edu-card.featured, .edu-grid > .edu-card:last-child, .extras > :first-child, .contact-actions > :last-child { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 18px 16px; }
  .chip { font-size: .72rem; padding: 7px 10px; }
  .chip.c1 { left: -4%; } .chip.c2 { right: -6%; } .chip.c3 { left: -6%; }
  .timeline::before, .timeline-fill { left: 11px; }
  .tl-item { padding-left: 38px; }
  .tl-node { left: 0; width: 24px; height: 24px; }
  .tl-card { padding: 22px 20px; }
  .rack { padding: 16px 26px 20px; }
  .rack::before { left: 8px; } .rack::after { right: 8px; }
  .unit { gap: 10px; padding: 0 12px; }
  .unit[aria-pressed="true"], .unit:hover { transform: none; }
  .status { font-size: .72rem; padding: 7px 12px 7px 10px; }
  .contact-card { padding-inline: 16px; }
  .contact-tile { padding: 14px; gap: 12px; }
  .contact-tile .card-icon { width: 42px; height: 42px; }
  .contact-cta .btn { flex: 1 1 100%; }
  .vent { width: 40px; }
  .term-body { height: 400px; padding: 14px; font-size: .82rem; }
  .term-out .t-grid { grid-template-columns: 1fr; }
  .term-out .t-grid > :nth-child(odd) { margin-top: 6px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .to-top { right: 14px; bottom: 14px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js .hero-in { opacity: 1; translate: none; }
}
