/* ============================================================
   Encabezado del apunte
   ------------------------------------------------------------
   Capa: componente
   ============================================================ */

/* ═══════════════════════════════════════════════════
   HERO — inmersivo, con formas decorativas
═══════════════════════════════════════════════════ */
.hero {
  position: relative;
  margin-top: var(--navbar-h);
  padding: 80px 24px 72px;
  /* --hero-a/b/c los define SOLO Premium. Sin fallback, en cualquier
     otro layout las tres var() quedan sin resolver, la declaracion es
     invalida y `background` cae a transparente. Hoy no se nota porque
     Neo, Atlas y Aurora pisan `.hero { background }` en su firma, pero
     un layout nuevo que no lo haga se quedaba con el hero en blanco —
     justo lo contrario del criterio "crear un layout sin tocar los
     componentes". Con el fallback, lo peor que pasa es un hero liso.
     Mismo patron que ya usan gatas.css y grafico.css. */
  background: linear-gradient(135deg, var(--hero-a, var(--bg2)) 0%, var(--hero-b, var(--bg2)) 50%, var(--hero-c, var(--bg2)) 100%);
  text-align: center;
  overflow: hidden;
  animation: heroReveal .7s cubic-bezier(.22,1,.36,1) forwards;
}

/* Formas geométricas decorativas en el hero */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(255,255,255,.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 15% 80%, rgba(var(--accent-2-rgb),.12) 0%, transparent 55%);
  pointer-events: none;
}
.hero-shapes {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.hero-shapes span {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.2);
}
.hero-shapes span:nth-child(1) {
  width: 220px; height: 220px; top: -80px; right: 8%;
  animation: floatShape 8s ease-in-out infinite;
}
.hero-shapes span:nth-child(2) {
  width: 140px; height: 140px; bottom: -50px; left: 5%;
  animation: floatShape 10s ease-in-out infinite reverse;
  border-style: dashed;
}
.hero-shapes span:nth-child(3) {
  width: 80px; height: 80px; top: 20%; left: 12%;
  animation: floatShape 6s ease-in-out infinite 2s;
  border-color: rgba(var(--accent-2-rgb),.15);
}
.hero-shapes span:nth-child(4) {
  width: 300px; height: 300px; bottom: -120px; right: -60px;
  animation: floatShape 12s ease-in-out infinite 1s;
  border-color: rgba(255,255,255,.08);
}

/* línea horizontal decorativa */
.hero-line {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-2) 0%, #3d4ecc 40%, var(--accent-2) 100%);
}

@keyframes floatShape {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(4deg); }
  66%       { transform: translateY(6px) rotate(-2deg); }
}
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Badge */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 500;
  background: rgba(var(--accent-2-rgb),.15);
  color: var(--accent-2);
  padding: 5px 16px; border-radius: 20px;
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 20px;
  border: 1px solid rgba(var(--accent-2-rgb),.12);
  backdrop-filter: blur(8px);
  animation: fadeUp .5s .15s both;
}
.hero-badge::before {
  content: '';
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent-2);
  opacity: .6;
}

/* Título */
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 900;
  color: var(--accent-2);
  line-height: 1.08;
  margin-bottom: 16px;
  letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(var(--accent-2-rgb),.12);
  animation: fadeUp .5s .25s both;
}

/* Subtítulo */
.hero p {
  font-size: 1.05rem;
  color: rgba(var(--accent-2-rgb),.72);
  max-width: 560px; margin: 0 auto 24px;
  line-height: 1.65;
  font-weight: 400;
  animation: fadeUp .5s .35s both;
}

/* ── Segunda línea del hero: la frase descriptiva ────────────
   $apunte_subtitulo (opcional). Repone la ranura que los apuntes
   .html viejos tenían con esta misma clase y que se perdió al
   pasar al sistema PHP — por eso cuatro apuntes habían terminado
   metiendo la frase adentro de $apunte_tema.

   NO se le da color ni tamaño propios de layout a propósito: las
   cinco firmas ya estilan `.hero p` (color y ancho), así que esto
   hereda la paleta de cada una y solo la matiza para que se lea
   como subtítulo y no como una segunda línea del mismo rango.

   El `:has()` junta las dos líneas: sin él —navegador viejo— el
   único efecto es que quedan 24 px separadas en vez de 8. Se ve
   más aireado, no roto. */
.hero .hero-sub {
  font-size: .95rem;
  opacity: .82;
  max-width: 620px;
  margin-bottom: 22px;
  animation-delay: .42s;   /* entra apenas después de la línea de arriba */
}
.hero p:not(.hero-sub):has(+ .hero-sub) { margin-bottom: 8px; }

@media (max-width: 640px) {
  .hero .hero-sub { font-size: .9rem; }
}

/* Metadatos (tiempo de lectura) */
.hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  animation: fadeUp .5s .45s both;
}
.reading-time-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .7rem;
  background: rgba(var(--accent-2-rgb),.1);
  color: var(--accent-2); padding: 6px 16px; border-radius: 20px;
  border: 1px solid rgba(var(--accent-2-rgb),.1);
}
.reading-time-badge::before {
  content: '';
  display: inline-block; width: 10px; height: 10px;
  border: 1.5px solid var(--accent-2); border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.reading-time-badge.ready::before { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
