/* ── Hero con máscara de scroll ─────────────────────────────────────────────
   Pista de 300vh con contenedor sticky. La capa realista se revela con un
   círculo de clip-path que crece con el scroll; debajo queda la capa wireframe.
   Sin soporte de animation-timeline la capa realista se muestra completa. */
.heroe { height: 300vh; position: relative; }
.heroe__fijo {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
}
.heroe__capa {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  background-size: cover;
  background-position: center;
}
.heroe__capa--boceto {
  background-image:
    linear-gradient(rgba(12, 17, 40, 0.55), rgba(12, 17, 40, 0.85)),
    url('/assets/img/hero-outline.avif');
}
.heroe__capa--real {
  background-image:
    linear-gradient(rgba(12, 17, 40, 0.35), rgba(12, 17, 40, 0.8)),
    url('/assets/img/hero-real.avif');
}
.heroe__titulo { font-size: var(--paso-5); max-width: 16ch; }
.heroe__sub { color: var(--texto-suave); font-size: var(--paso-1); max-width: 44ch; margin-top: 1.25rem; }
.heroe__flecha {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  translate: -50% 0;
  color: var(--texto-secundario);
  animation: rebote 1.6s ease-in-out infinite;
}
@supports (animation-timeline: view()) {
  .heroe { view-timeline-name: --heroe; view-timeline-axis: block; }
  .heroe__capa--real {
    animation: revelar-mascara auto linear both;
    animation-timeline: --heroe;
    animation-range: contain 0% contain 85%;
  }
  .heroe__capa--boceto > * {
    animation: acercar auto linear both;
    animation-timeline: --heroe;
    animation-range: contain 0% contain 60%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .heroe { height: auto; }
  .heroe__fijo { position: static; height: auto; min-height: 100vh; }
  .heroe__capa--boceto { display: none; }
  .heroe__capa--real { clip-path: none !important; animation: none !important; }
}

/* ── Cinta infinita del stack ──────────────────────────────────────────── */
.cinta { padding: 4rem 0; overflow: hidden; position: relative; }
.cinta__cabecera { text-align: center; margin-bottom: 2.5rem; }
.cinta__pista {
  display: flex;
  gap: 4rem;
  width: max-content;
  animation: cinta 40s linear infinite;
}
.cinta__item {
  font-family: var(--fuente-mono);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--texto-secundario);
  white-space: nowrap;
}
.cinta::before, .cinta::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8rem;
  z-index: 1;
  pointer-events: none;
}
.cinta::before { left: 0; background: linear-gradient(90deg, var(--fondo), transparent); }
.cinta::after { right: 0; background: linear-gradient(-90deg, var(--fondo), transparent); }
@media (prefers-reduced-motion: reduce) {
  .cinta__pista { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* ── Sistema AOS: rejilla 2x2 de tarjetas de vidrio ────────────────────── */
.fases { padding: 8rem 0; }
.fases__cabecera { text-align: center; margin-bottom: 3.5rem; }
.fases__cabecera p { margin: 1rem auto 0; color: var(--texto-secundario); }
.fases__rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.fase {
  position: relative;
  border-radius: 1.5rem;
  padding: 2.25rem 2rem 2rem;
  overflow: hidden;
  transition: border-color var(--dur-corta) var(--curva), transform var(--dur-corta) var(--curva);
}
.fase:hover { border-color: var(--vidrio-borde-fuerte); transform: translateY(-4px); }
.fase__numeral {
  position: absolute;
  top: -1.4rem;
  right: -0.4rem;
  font-size: 6.5rem;
  font-weight: 900;
  line-height: 1;
  background: var(--degradado);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.22;
}
.fase__nombre { margin: 0.5rem 0 0.75rem; font-size: var(--paso-2); }
.fase p { color: var(--texto-secundario); margin: 0; }

/* ── Galería expansiva de tecnologías ──────────────────────────────────── */
.stack { padding: 6rem 0; }
.stack .envoltura { width: min(100% - 2.5rem, 87.5rem); }
.stack__cabecera { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2.5rem; gap: 1rem; flex-wrap: wrap; }
.stack__galeria { display: flex; gap: 0.75rem; height: 400px; }
.panel {
  position: relative;
  flex: 1;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--vidrio-borde);
  transition: flex 0.6s var(--curva-galeria);
}
.panel__fondo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 1s var(--curva);
}
.panel:hover .panel__fondo { transform: scale(1.05); }
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.75));
}
.panel:hover, .panel:focus-within { flex: 4; }
.panel__texto {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 1.5rem;
}
.panel__nombre { font-weight: 800; font-size: 1.2rem; }
.panel__detalle {
  color: var(--texto-suave);
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
  max-width: 38ch;
  opacity: 0;
  transition: opacity var(--dur-media) var(--curva) 0.15s;
}
.panel:hover .panel__detalle, .panel:focus-within .panel__detalle { opacity: 1; }
@media (max-width: 48rem) {
  .stack__galeria { flex-direction: column; height: auto; }
  .panel { min-height: 130px; }
  .panel:hover, .panel:focus-within { flex: 2.5; }
  .panel__detalle { opacity: 1; }
}

/* ── Sobre mí: contenido dividido ──────────────────────────────────────── */
.sobre { padding: 8rem 0; position: relative; }
.sobre::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.05);
  filter: blur(120px);
  pointer-events: none;
}
.sobre__rejilla { display: grid; gap: 3rem; }
@media (min-width: 64rem) { .sobre__rejilla { grid-template-columns: 1fr 1fr; align-items: center; } }
.sobre__texto p { color: var(--texto-secundario); }
.sobre__datos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.5rem; }
.dato__cifra { font-size: var(--paso-3); font-weight: 900; }
.dato__nombre { color: var(--texto-secundario); font-size: 0.9rem; }
