/* octopus-button.css
   Botón "Abrir Distamus Octopus" con borde de gradiente animado (aurora/glow).
   Se importa ÚNICAMENTE en el artículo que lo necesita, vía <link> en el Markdown.
   Interior transparente + resplandor alrededor del borde. */

@property --octo-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.octopus-cta {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.octopus-cta .octopus-button {
  /* Gradiente azul/violeta que gira lentamente alrededor del borde */
  --octo-grad: conic-gradient(
    from var(--octo-angle),
    #3b82f6, #6366f1, #8b5cf6, #a855f7, #6366f1, #3b82f6
  );
  --octo-glow: 0.18; /* Modo claro: resplandor muy sutil */

  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.9rem;
  border-radius: 18px;
  background: transparent;         /* Interior transparente */
  color: var(--text-primary);      /* Oscuro en claro, blanco en oscuro */
  font-family: "Lexend", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;           /* Anula el subrayado de .post-content a */
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.3s ease,
    color 0.3s ease;
}

/* Anillo de gradiente animado. La máscara deja el interior transparente:
   solo se pinta el borde (área entre content-box y border-box). */
.octopus-cta .octopus-button::before,
.octopus-cta .octopus-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;                    /* Grosor del borde */
  background: var(--octo-grad);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
          mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  animation: octo-rotate 6s linear infinite;
}

/* Segunda capa idéntica pero difuminada = resplandor alrededor del borde */
.octopus-cta .octopus-button::after {
  z-index: -1;
  filter: blur(10px);
  opacity: var(--octo-glow);
}

@keyframes octo-rotate {
  to { --octo-angle: 360deg; }
}

/* Hover: brillo ligeramente mayor, escala 1.03 y glow más intenso */
.octopus-cta .octopus-button:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}
.octopus-cta .octopus-button:hover::after {
  opacity: calc(var(--octo-glow) + 0.3);
  filter: blur(14px);
}

/* Active: pequeña animación de presión */
.octopus-cta .octopus-button:active {
  transform: scale(0.98);
  transition-duration: 0.09s;
}

/* Focus visible para accesibilidad */
.octopus-cta .octopus-button:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 4px;
}

/* Modo oscuro: glow ligeramente más intenso (el texto ya es blanco vía --text-primary) */
html.dark .octopus-cta .octopus-button {
  --octo-glow: 0.42;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .octopus-cta .octopus-button {
    --octo-glow: 0.42;
  }
}

/* Accesibilidad: respeta la preferencia de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  .octopus-cta .octopus-button::before,
  .octopus-cta .octopus-button::after {
    animation: none;
  }
}
