@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #05060b;
  --text: #e7e8f0;
  --muted: #8b90a5;
  --dim: #5a5f75;
  --line: rgba(143, 140, 255, .16);

  --green: #3dffa2;                 /* fósforo: solo señales "vivas" */
  --cyan: 90, 200, 250;
  --indigo: 125, 122, 255;
  --violet: 191, 90, 242;
  --grad: linear-gradient(90deg, rgb(var(--cyan)), rgb(var(--indigo)) 50%, rgb(var(--violet)));

  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(1rem, 5vw, 3rem);
  --radius: 16px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono-font: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 3rem; -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fondo fijo en dos capas: rejilla tenue + resplandores de la paleta */
body::before, body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background:
    linear-gradient(rgba(143, 140, 255, .035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(143, 140, 255, .035) 1px, transparent 1px) 0 0 / 56px 56px;
}
body::after {
  z-index: -2;
  background:
    radial-gradient(50rem 36rem at 0% 0%, rgba(var(--indigo), .14), transparent 60%),
    radial-gradient(46rem 34rem at 100% 100%, rgba(var(--violet), .10), transparent 60%),
    var(--bg);
}

h1, h2, h3, p, ul, ol, pre, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--green); outline-offset: 4px; border-radius: 4px; }
::selection { background: rgba(var(--indigo), .45); color: #fff; }

.mono { font-family: var(--mono-font); letter-spacing: 0; font-feature-settings: "calt" 0; }
.g { color: var(--green); }
.c { color: rgb(var(--cyan)); }
.dim { color: var(--dim); }

/* ---------- Navegación ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  font-size: 0.8125rem;
  color: var(--muted);
  background: rgba(5, 6, 11, .7);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-name { margin-right: auto; color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 0.6rem; }
.nav-logo { height: 1.9rem; width: auto; display: block; }

/* Selector de idioma: siempre visible (también en móvil, donde se oculta el menú) */
.lang { display: flex; align-items: center; gap: 0.2rem; margin-left: 1.5rem; }
.lang a { padding: 0.35rem 0.4rem; border-radius: 6px; color: var(--muted); transition: color .2s, text-shadow .2s, background .2s; }
.lang a:hover { color: var(--text); text-shadow: 0 0 12px rgba(var(--indigo), .8); }
.lang a[aria-current="page"] { color: var(--text); background: rgba(var(--indigo), .14); box-shadow: inset 0 0 0 1px rgba(var(--indigo), .35); }
.nav nav { display: flex; gap: 1.5rem; }
.nav nav a { transition: color .2s, text-shadow .2s; }
.nav nav a:hover { color: var(--text); text-shadow: 0 0 12px rgba(var(--indigo), .8); }
@media (max-width: 680px) { .nav nav { display: none; } }

/* ---------- Secciones ---------- */

.sec {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(6rem, 15vh, 9rem) var(--gutter);
}
.sec.full { min-height: 100vh; min-height: 100svh; }
.sec.band { padding-block: clamp(4rem, 10vh, 6rem); border-top: 1px solid var(--line); }
.wrap { position: relative; width: 100%; max-width: 66rem; margin: 0 auto; }
.center { text-align: center; }

/* Cabecera de sección: etiqueta mono + traza que se extiende */
.sec-id {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-transform: lowercase;
}
.sec-id::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--indigo), .5), transparent);
}
.center .sec-id { justify-content: center; }
.center .sec-id::after { display: none; }

.title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.lead {
  margin-top: 1rem;
  max-width: 44ch;
  font-size: clamp(1.125rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--muted);
}
.center .lead { margin-inline: auto; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(var(--indigo), .35));
}

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

.hero { justify-content: center; text-align: center; }
.hero-inner { position: relative; width: 100%; }

/* Suelo en perspectiva: SVG precalculado en 2D (los transform 3D con máscara
   no se pintan en Safari/iOS y en móvil quedaban recortados) */
.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: -1;
  background: url("/img/floor.svg") center bottom / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(0deg, rgba(0,0,0,.85) 0%, transparent 90%);
  mask-image: linear-gradient(0deg, rgba(0,0,0,.85) 0%, transparent 90%);
  opacity: .7;
}
@media (max-width: 560px) { .hero::before { height: 30%; } }
/* Resplandor detrás del nombre */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40rem 22rem at 50% 52%, rgba(var(--indigo), .22), transparent 70%),
    radial-gradient(26rem 16rem at 35% 45%, rgba(var(--cyan), .08), transparent 70%),
    radial-gradient(26rem 16rem at 65% 58%, rgba(var(--violet), .10), transparent 70%);
}

/* Anillo "puente": la foto es cálida (piel, pared ámbar) y la web fría.
   Capas de dentro afuera: resplandor cálido pegado a la foto -> anillo con
   degradado melocotón/rosa -> violeta/índigo -> halo índigo amplio -> órbita cian fina. */
.avatar-ring {
  position: relative;
  width: clamp(6.75rem, 12.5vw, 9rem);
  aspect-ratio: 1;
  margin: 0 auto 2.25rem;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 160deg,
    #ffc79a, #ff9f8f 18%, #e58bd0 34%, rgb(var(--violet)) 50%,
    rgb(var(--indigo)) 68%, #b79bff 84%, #ffc79a);
  box-shadow:
    0 0 14px 1px rgba(255, 176, 128, .38),
    0 0 46px 6px rgba(229, 139, 208, .22),
    0 0 90px 16px rgba(var(--indigo), .32),
    0 0 150px 30px rgba(var(--violet), .12);
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 1px solid rgba(var(--cyan), .22);
  -webkit-mask-image: linear-gradient(200deg, #000 20%, transparent 75%);
  mask-image: linear-gradient(200deg, #000 20%, transparent 75%);
}
.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #0b0a14;
  object-fit: cover;
}

.prompt {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: clamp(0.8125rem, 1.4vw, 0.9375rem);
  color: var(--muted);
}
/* "whoami" se escribe al cargar */
.typed {
  display: inline-block;
  white-space: nowrap;
  color: var(--text);
}
/* La palabra completa es el estado base y la animación usa "backwards": Safari no
   aplica el último paso de steps() con "both" y se quedaba en "whoam". */
.js .typed { clip-path: inset(0 100% 0 0); }
.js.ready .typed { clip-path: inset(0 0 0 0); animation: type .7s steps(6) .6s backwards; }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

h1 {
  font-size: clamp(3.25rem, 12vw, 9.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.05em;
  padding-bottom: 0.06em;
  background: linear-gradient(180deg, #ffffff 25%, #b9b7ff 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 36px rgba(var(--indigo), .35));
}

.role {
  margin-top: 1.5rem;
  font-size: clamp(0.9375rem, 2vw, 1.25rem);
  color: #c9cbe0;
}
.role .nw { white-space: nowrap; }
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 0.3em;
  vertical-align: -0.2em;
  background: var(--green);
  box-shadow: 0 0 10px rgba(61, 255, 162, .8), 0 0 22px rgba(61, 255, 162, .35);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 560px) {
  .role .sep { display: none; }
  .role .nw { display: block; }
}

.scroll-cue {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  translate: -50% 0;
  font-size: 0.75rem;
  color: var(--dim);
  transition: color .2s;
}
.scroll-cue:hover { color: var(--green); }

/* ---------- Tarjetas (vidrio oscuro + glow al pasar) ---------- */

.card {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 24, 40, .86), rgba(12, 13, 24, .86));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 24px 48px -28px rgba(0, 0, 0, .9);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease), translate .35s var(--ease);
}
@media (hover: hover) {
  .card:hover {
    translate: 0 -3px;
    border-color: rgba(var(--indigo), .55);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .06),
      0 0 0 1px rgba(var(--indigo), .25),
      0 0 36px -6px rgba(var(--indigo), .45),
      0 24px 48px -28px rgba(0, 0, 0, .9);
  }
}

/* ---------- Experiencia ---------- */

.timeline {
  position: relative;
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  padding-left: 2.25rem;
  display: grid;
  gap: 1.25rem;
}
/* Traza vertical que conecta las entradas */
.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 2rem;
  bottom: 2rem;
  width: 1px;
  background: linear-gradient(180deg, var(--green), rgba(var(--indigo), .6) 30%, rgba(var(--indigo), .1));
}
.timeline .card::before {
  content: "";
  position: absolute;
  left: calc(-2.25rem + 0.5rem - 4px);
  top: 2.05rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(var(--indigo), .8);
}
.timeline .card:first-child::before {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(61, 255, 162, .9);
}
/* Conector horizontal desde la traza hasta la tarjeta */
.timeline .card::after {
  content: "";
  position: absolute;
  left: calc(-2.25rem + 0.5rem + 5px);
  top: calc(2.05rem + 4px);
  width: calc(2.25rem - 0.5rem - 5px);
  height: 1px;
  background: rgba(var(--indigo), .45);
}

.when {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--cyan));
}
.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.card h3 {
  margin-top: 0.6rem;
  font-size: clamp(1.375rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.org { margin-top: 0.2rem; font-size: 0.875rem; color: rgb(var(--indigo)); }
.card > p:not(.when):not(.org) { margin-top: 0.85rem; max-width: 58ch; color: var(--muted); }
.card > p:not(.when):not(.org) + p { margin-top: 0.35rem; }

/* ---------- QuantumReady ---------- */

/* Trazas de circuito al fondo, difuminadas hacia los bordes */
.circuit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/img/circuit.svg") 0 0 / 320px 320px;
  opacity: .22;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 55% at 70% 40%, #000 0%, transparent 75%);
}
.circuit::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(44rem 30rem at 80% 20%, rgba(var(--indigo), .16), transparent 65%),
    radial-gradient(30rem 24rem at 5% 85%, rgba(var(--cyan), .07), transparent 60%);
  border-top: 1px solid var(--line);
}

.stats {
  margin-top: clamp(2.75rem, 7vh, 4rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.stats li { display: flex; flex-direction: column; gap: 0.4rem; }
.num {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 30%, rgb(var(--indigo)) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.num small { font-size: 0.45em; letter-spacing: 0; margin-left: 0.1em; }
.cap { font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 680px) { .stats { grid-template-columns: 1fr 1fr; } .stats li:last-child { grid-column: 1 / -1; } }

/* Pipeline de fases: cada nodo dibuja su tramo hasta el siguiente (así la línea
   siempre pasa por el centro de los puntos), con un pulso que la recorre. */
.pipeline {
  --n: 15px;                                   /* diámetro del nodo */
  position: relative;
  margin-top: clamp(2rem, 6vh, 3.25rem);
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  font-size: 0.75rem;
  color: var(--muted);
  /* banda oscura que tapa las trazas del circuito de fondo bajo la línea */
  background: radial-gradient(ellipse 62% 75% at 50% 45%, rgba(5, 6, 11, .96) 55%, transparent 100%);
}
.pipeline li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 0 0.25rem;
}
/* tramo desde el centro de este nodo hasta el centro del siguiente */
.pipeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--n) / 2 - 0.5px);
  left: 50%;
  width: 100%;
  height: 1px;
  background: rgb(var(--indigo));
}
.pipeline li:first-child::after { background: linear-gradient(90deg, rgb(var(--cyan)), rgb(var(--indigo))); }
.pipeline li.done:has(+ .milestone)::after { background: linear-gradient(90deg, rgb(var(--indigo)), rgb(var(--violet))); }
.pipeline li.milestone::after { background: rgba(var(--violet), .6); }

.pipeline .node {
  position: relative;
  z-index: 1;
  width: var(--n);
  height: var(--n);
  margin-bottom: 0.5rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgb(var(--indigo));
  transition: box-shadow .3s, scale .3s var(--ease);
}
.pipeline .done .node {
  background: radial-gradient(circle, #fff 0 2px, rgb(var(--indigo)) 3px);
  box-shadow: 0 0 12px rgba(var(--indigo), .7);
}
.pipeline .milestone .node { border-color: rgb(var(--violet)); box-shadow: 0 0 0 3px rgba(var(--violet), .12); }
.pipeline b { font-weight: 600; color: var(--text); }
.pipeline li:hover .node { scale: 1.25; box-shadow: 0 0 18px rgba(var(--indigo), .9); }

/* Pulso: destello fino que corre por dentro de la línea, por detrás de los nodos
   (z-index 0, nodos en 1), de F1 a F6. */
.pipeline::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(1.25rem + var(--n) / 2 - 1px);
  left: calc(100% / 12 - 24px);
  width: 48px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(61, 255, 162, .9) 35%, #eafff4 50%, rgba(61, 255, 162, .9) 65%, transparent);
  box-shadow: 0 0 8px rgba(61, 255, 162, .55);
  animation: packet-h 3.4s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes packet-h {
  0%   { left: calc(100% / 12 - 24px); opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: calc(100% - 100% / 12 - 24px); opacity: 0; }
}

/* Al aparecer (solo móvil): nodos F1→F6 en secuencia, cada tramo se dibuja tras
   su nodo. En escritorio, la línea aparece entera como siempre. */
@media (min-width: 681px) {
  html.js .pipeline.r .node { opacity: 1; }
  html.js .pipeline.r.in .node, html.js .pipeline.r.in li:not(:last-child)::after { animation: none; }
  html.js .pipeline.r li:not(:last-child)::after { transform: none; }
  html.js .pipeline.r.in::after { animation-delay: 0s; }
}
.js .pipeline.r li { --d: 0s; }   /* el nodo y el tramo heredan el retraso de su fase */
.js .pipeline.r li:nth-child(2) { --d: .12s; }
.js .pipeline.r li:nth-child(3) { --d: .24s; }
.js .pipeline.r li:nth-child(4) { --d: .36s; }
.js .pipeline.r li:nth-child(5) { --d: .48s; }
.js .pipeline.r li:nth-child(6) { --d: .60s; }
.js .pipeline.r .node { opacity: 0; }
.js .pipeline.r.in .node { opacity: 1; animation: node-on .45s var(--ease) both; animation-delay: calc(.15s + var(--d)); }
.js .pipeline.r li:not(:last-child)::after { transform: scaleX(0); transform-origin: left center; }
.js .pipeline.r.in li:not(:last-child)::after { transform: none; animation: seg-draw .3s ease-out both; animation-delay: calc(.3s + var(--d)); }
.js .pipeline.r.in::after { animation-delay: 1.1s; }
@keyframes node-on { from { opacity: 0; transform: scale(.4); } 60% { transform: scale(1.15); } to { opacity: 1; transform: none; } }
@keyframes seg-draw { from { transform: scaleX(0); } to { transform: none; } }
@keyframes seg-draw-v { from { transform: scaleY(0); } to { transform: none; } }

.legend {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--dim);
}
.legend .k { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgb(var(--indigo)); }
.legend .k.done { background: rgb(var(--indigo)); }
.legend .k.milestone { border-color: rgb(var(--violet)); margin-left: 1rem; }

@media (max-width: 680px) {
  .pipeline {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 0.75rem 0;
    background: radial-gradient(ellipse 85% 60% at 30% 50%, rgba(5, 6, 11, .96) 55%, transparent 100%);
  }
  .pipeline li { height: 1.25rem; flex-direction: row; align-items: center; gap: 0.75rem; text-align: left; padding: 0; }
  .js .pipeline.r li:not(:last-child)::after { transform: scaleY(0); transform-origin: center top; }
  .js .pipeline.r.in li:not(:last-child)::after { animation-name: seg-draw-v; }
  .pipeline .node { margin: 0; flex: none; }
  /* tramo vertical: del centro de este nodo al centro del siguiente */
  .pipeline li:not(:last-child)::after {
    top: 50%;
    left: calc(var(--n) / 2 - 0.5px);
    width: 1px;
    height: calc(100% + 1.1rem);
  }
  .pipeline li:first-child::after { background: linear-gradient(180deg, rgb(var(--cyan)), rgb(var(--indigo))); }
  .pipeline li.done:has(+ .milestone)::after { background: linear-gradient(180deg, rgb(var(--indigo)), rgb(var(--violet))); }
  .pipeline::after {
    left: calc(var(--n) / 2 - 1px);
    top: calc(0.75rem + 0.625rem - 20px);
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(61, 255, 162, .9) 35%, #eafff4 50%, rgba(61, 255, 162, .9) 65%, transparent);
    animation-name: packet-v;
  }
  @keyframes packet-v {
    0%   { top: calc(0.75rem + 0.625rem - 20px); opacity: 0; }
    8%   { opacity: 1; }
    88%  { opacity: 1; }
    100% { top: calc(100% - 0.75rem - 0.625rem - 20px); opacity: 0; }
  }
  .legend { justify-content: flex-start; }
}

/* Ventanas de terminal con salida real */
.terms {
  margin-top: clamp(3rem, 8vh, 4.5rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (max-width: 860px) { .terms { grid-template-columns: 1fr; } }

.term {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 9, 16, .85);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
@media (hover: hover) {
  .term:hover {
    border-color: rgba(var(--indigo), .55);
    box-shadow: 0 0 40px -8px rgba(var(--indigo), .45), 0 30px 60px -30px rgba(0, 0, 0, .95);
  }
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.6875rem;
  color: var(--dim);
  background: rgba(255, 255, 255, .025);
  border-bottom: 1px solid var(--line);
}
.term-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.term-bar span { margin-left: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term pre {
  padding: 1rem 1.1rem;
  font-size: clamp(0.6875rem, 1.05vw, 0.8125rem);
  line-height: 1.7;
  color: #c9cbe0;
  overflow-x: auto;
  white-space: pre;
}
.term .ok { color: var(--green); text-shadow: 0 0 8px rgba(61, 255, 162, .45); }
.term .no { color: #ff6b8b; }
.term .k  { color: rgb(var(--cyan)); }
.term .v  { color: rgb(var(--violet)); }
.term-note {
  margin-top: auto;
  padding: 0.9rem 1.1rem 1.1rem;
  font-size: 0.9375rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
}

.btn {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text);
  background: rgba(var(--indigo), .08);
  border: 1px solid rgba(var(--indigo), .45);
  transition: box-shadow .25s, border-color .25s, background .25s;
}
.btn:hover {
  background: rgba(var(--indigo), .16);
  border-color: rgb(var(--indigo));
  box-shadow: 0 0 24px -4px rgba(var(--indigo), .7);
}
.btn.htmx-request { opacity: .6; }

.fases { margin-top: 2.5rem; display: grid; gap: 0.9rem; }
.fases li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: baseline;
  max-width: 64ch;
  color: var(--muted);
  animation: rise .6s var(--ease) both;
}
.fases li span { font-family: var(--mono-font); font-size: 0.8125rem; color: rgb(var(--indigo)); }
.fases li span::before { content: "F"; }
.fases li b { color: var(--text); font-weight: 600; }
.fases li:nth-child(2) { animation-delay: .05s; }
.fases li:nth-child(3) { animation-delay: .10s; }
.fases li:nth-child(4) { animation-delay: .15s; }
.fases li:nth-child(5) { animation-delay: .20s; }
.fases li:nth-child(6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.links { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; font-size: 0.875rem; }
.center .links { justify-content: center; }
.links a { color: rgb(var(--cyan)); transition: text-shadow .2s, color .2s; }
.links a:hover { color: #fff; text-shadow: 0 0 12px rgba(var(--cyan), .8); }

.foot {
  padding: 2.5rem var(--gutter) 2rem;
  font-size: 0.75rem;
  text-align: center;
  color: var(--dim);
}
.foot p { margin: 0.9rem 0 0; }
.foot-logo {
  height: 40px;
  width: auto;
  display: inline-block;
  filter: drop-shadow(0 0 7px rgba(61, 255, 162, .5));
  animation: foot-glow 5s ease-in-out infinite;
}
@keyframes foot-glow {
  50% { filter: drop-shadow(0 0 12px rgba(61, 255, 162, .85)); }
}
@media (prefers-reduced-motion: reduce) {
  .foot-logo { animation: none; }
}

/* ---------- Educación ---------- */

.edu {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
@media (max-width: 760px) { .edu { grid-template-columns: 1fr; } }

/* ---------- Stack técnico ---------- */

.stack { margin-top: clamp(2.5rem, 6vh, 3.5rem); padding-block: 0.5rem; }
.stack > div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem 1.5rem;
  padding: 1.05rem 0;
}
.stack > div + div { border-top: 1px dashed var(--line); }
.stack dt { padding-top: 0.45rem; font-size: 0.8125rem; color: var(--muted); }
.stack dd {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 0.75rem;
}
.lvl { font-size: 0.6875rem; color: var(--dim); }
.lvl::before { content: "# "; }
.stack dt::before { content: "./"; color: var(--dim); }
.stack dd { margin: 0; }
@media (max-width: 480px) {
  .stack dd { grid-template-columns: 1fr; gap: 0.4rem; }
  .lvl:not(:first-child) { margin-top: 0.4rem; }
}
@media (max-width: 640px) { .stack > div { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
/* principal: chip lleno y luminoso */
.chips li {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #f1f2fb;
  background: linear-gradient(180deg, rgba(var(--indigo), .22), rgba(var(--indigo), .12));
  border: 1px solid rgba(var(--indigo), .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 14px -6px rgba(var(--indigo), .7);
  transition: border-color .25s, box-shadow .25s, color .25s, translate .25s var(--ease);
}
/* también: chip de contorno discontinuo, apagado */
.chips.alt li {
  color: var(--muted);
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, .14);
  box-shadow: none;
}
@media (hover: hover) {
  .chips li:hover {
    translate: 0 -2px;
    color: #fff;
    border-color: rgba(var(--cyan), .7);
    box-shadow: 0 0 0 1px rgba(var(--cyan), .2), 0 0 18px -2px rgba(var(--cyan), .55);
  }
}

/* Aparición por filas (solo móvil, donde la tarjeta es muy alta): cada categoría
   entra al asomar y sus chips llegan en cascada. En escritorio, como siempre. */
@media (min-width: 681px) {
  html.js .stack > div.r, html.js .stack > div.r .chips li { opacity: 1; }
  html.js .stack > div.r.in, html.js .stack > div.r.in .chips li { animation: none; }
}
.js .stack > div.r.in:nth-child(2) { animation-delay: .06s; }
.js .stack > div.r.in:nth-child(3) { animation-delay: .12s; }
.js .stack > div.r.in:nth-child(4) { animation-delay: .18s; }
.js .stack > div.r .chips li { opacity: 0; }
.js .stack > div.r.in .chips li { opacity: 1; animation: chip-in .45s var(--ease) both; }
.js .stack > div.r.in .chips li:nth-child(2) { animation-delay: .04s; }
.js .stack > div.r.in .chips li:nth-child(3) { animation-delay: .08s; }
.js .stack > div.r.in .chips li:nth-child(4) { animation-delay: .12s; }
.js .stack > div.r.in .chips li:nth-child(5) { animation-delay: .16s; }
.js .stack > div.r.in .chips li:nth-child(6) { animation-delay: .20s; }
.js .stack > div.r.in .chips li:nth-child(7) { animation-delay: .24s; }
.js .stack > div.r.in .chips li:nth-child(8) { animation-delay: .28s; }
.js .stack > div.r.in .chips.alt li { animation-delay: .2s; }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Open source ---------- */

.cards {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1.25rem;
}
.pr { display: flex; flex-direction: column; gap: 1rem; height: 100%; }
.pr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.pr-repo { font-size: clamp(1.375rem, 2.6vw, 1.75rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.pr-org { display: block; margin-bottom: 0.2rem; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.pr-num {
  flex: none;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #c9a7ff;
  background: rgba(163, 113, 247, .1);
  border: 1px solid rgba(163, 113, 247, .35);
}
.pr-desc { color: var(--muted); }
.pr-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
}
.pr-merged { color: var(--muted); }
.pr-merged::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: #a371f7;               /* morado "merged" de GitHub */
  box-shadow: 0 0 8px rgba(163, 113, 247, .8);
}
.pr-link { color: rgb(var(--cyan)); }
/* Móvil: pie con detalle → 1ª línea dato + enlace, 2ª línea el detalle a lo ancho */
@media (max-width: 680px) {
  .pr-foot { flex-wrap: wrap; row-gap: 0.25rem; }
  .pr-foot .dim:has(.pr-sub) { display: contents; }
  .pr-dot { display: none; }
  .pr-sub { order: 2; flex-basis: 100%; }
  .pr-link { white-space: nowrap; }
}

/* ---------- Próximamente ---------- */

.band .sec-id { margin-bottom: 1.25rem; }
.soon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.title-sm {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #c9cbe0;
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px dashed rgba(var(--indigo), .4);
}
.wip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--violet));
  box-shadow: 0 0 8px rgb(var(--violet));
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Contacto ---------- */

.contact-sec { border-top: 1px solid var(--line); }
.contact-sec::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50rem 26rem at 50% 120%, rgba(var(--indigo), .32), transparent 65%),
    radial-gradient(30rem 20rem at 20% 120%, rgba(var(--cyan), .12), transparent 60%);
}
.contact-sec .prompt { margin: 1.75rem 0 0; }
.contact {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.contact a {
  padding: 0.8rem 1.3rem;
  border-radius: 10px;
  font-size: clamp(0.875rem, 1.6vw, 1rem);
  color: var(--text);
  background: rgba(14, 16, 28, .75);
  border: 1px solid rgba(var(--indigo), .35);
  transition: border-color .25s, box-shadow .25s, translate .25s var(--ease);
}
@media (hover: hover) {
  .contact a:hover {
    translate: 0 -2px;
    border-color: rgb(var(--indigo));
    box-shadow: 0 0 28px -4px rgba(var(--indigo), .7);
  }
}

/* ---------- Entrada del hero ----------
   Oculto hasta que site.js marca <html class="ready"> (el navegador ya pinta:
   fuentes y foto listas, o 1,2 s como máximo). En iPhone, si arrancaba al leer
   el CSS, terminaba antes del primer pintado y aparecía de golpe. Sin JS se ve. */

.js .intro { opacity: 0; }
.js.ready .intro { opacity: 1; animation: intro .7s var(--ease) both; }
.js.ready .intro.i1 { animation-delay: .08s; }
.js.ready .intro.i2 { animation-delay: .16s; }
.js.ready .intro.i3 { animation-delay: .24s; }
@keyframes intro { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Aparición progresiva ---------- */

/* Mismo fundido que antes (0,8 s, 18 px, escalonado), pero con @keyframes: Safari
   en iPhone se saltaba a veces la transición y el contenido aparecía de golpe. */
.js .r {
  opacity: 0;
  transition: translate .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.js .r.in { opacity: 1; animation: reveal .8s var(--ease) both; }
.js .r.in.d1 { animation-delay: .08s; }
.js .r.in.d2 { animation-delay: .16s; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .r { opacity: 1; transform: none; transition: none; }
  .typed, .cursor, .live, .wip, .fases li, .intro, .js.ready .intro, .js.ready .typed, .js .r.in { animation: none; }
  .js .intro, .js .r, .js .stack > div.r .chips li, .js .pipeline.r .node { opacity: 1; }
  .js .stack > div.r.in .chips li, .js .pipeline.r.in .node, .js .pipeline.r.in li:not(:last-child)::after { animation: none; }
  .js .pipeline.r li:not(:last-child)::after { transform: none; }
  .js .typed { clip-path: none; }
  .pipeline::after { display: none; }
  .card, .term, .btn, .chips li, .contact a { transition: none; }
}

/* QuantumReady en vivo: la ventana de terminal con el clip (como un GIF) y, al lado
   (debajo en móvil), los dos enlaces. El póster está siempre debajo del vídeo: sin JS
   o con movimiento reducido es lo único que se ve. */
.qr-live {
  margin-top: clamp(2.25rem, 6vh, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 520px) auto;
  gap: 1.5rem 2.25rem;
  align-items: center;
}
.qr-live-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  /* The still poster (13 KB) shows at once, under the animation while it downloads. */
  background: #05060b url(/media/quantumready-poster.webp) center / cover no-repeat;
}
.qr-live-media video,
.qr-live-media .qr-live-anim img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.qr-live-side { display: grid; gap: 1.25rem; justify-items: start; }
.qr-live-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.qr-live-cta .btn { margin-top: 0; }
@media (max-width: 760px) {
  .qr-live { grid-template-columns: 1fr; }
  .qr-live-cta { flex-direction: row; flex-wrap: wrap; }
}
/* «En producción»: un punto verde que late despacio. */
.qr-live-dot {
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(61, 255, 162, .7);
  vertical-align: middle;
  animation: qr-live-pulse 2.4s ease-in-out infinite;
}
@keyframes qr-live-pulse { 50% { opacity: .7; box-shadow: 0 0 4px rgba(61, 255, 162, .3); } }
@media (prefers-reduced-motion: reduce) {
  .qr-live-dot { animation: none; }
}

/* The product's current figures: a smaller size for the long one (the key exchange). */
.num-sm { font-size: clamp(1.25rem, 2.6vw, 2rem); letter-spacing: -0.01em; line-height: 1.35; }
.stats-now { align-items: end; }
/* Stack tags under the links. */
.qr-stack { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.4rem; }
.qr-stack li {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
}
/* Origin: the research prototype it came from. */
.qr-origin { margin-top: clamp(3.5rem, 9vh, 5.5rem); padding-top: 2rem; border-top: 1px dashed var(--line); }
.qr-origin-title { font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 600; color: var(--text); }
.qr-origin-lead { margin-top: 0.6rem; max-width: 60ch; color: var(--muted); }
/* Never Safari's own play button over the clip (it would sit inside the link). */
.qr-live-media video::-webkit-media-controls,
.qr-live-media video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}
