/* CHAN Digital Manager — Mantenimiento
   Espacio 3D infinito, luces moradas con destellos, interacción de cursor. */

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

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

:root {
  --black: #050507;
  --black-2: #0a0714;
  --white: #f0f0f2;
  --purple: #7c3aed;
  --magenta: #c026d3;
  --violet: #a855f7;
  --fuchsia: #d946ef;
  --tiltX: 0deg;
  --tiltY: 0deg;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(ellipse at 50% 40%, var(--black-2), var(--black) 70%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: default;
}

/* ============ CANVAS WARP TUNNEL ============ */
#warp {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .8;
  mix-blend-mode: screen;
}

/* ============ CSS RING TUNNEL (profundidad extra) ============ */
.zoom-tunnel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 700px;
  z-index: 0;
  transform: rotateX(var(--tiltX)) rotateY(var(--tiltY));
  transition: transform .3s ease-out;
}

.zoom-ring {
  position: absolute;
  border: 1px solid rgba(168, 85, 247, .14);
  border-radius: 12px;
  animation: zoomIn 6s linear infinite;
  opacity: 0;
}

.zoom-ring:nth-child(1)  { animation-delay: 0s; }
.zoom-ring:nth-child(2)  { animation-delay: .5s; }
.zoom-ring:nth-child(3)  { animation-delay: 1s; }
.zoom-ring:nth-child(4)  { animation-delay: 1.5s; }
.zoom-ring:nth-child(5)  { animation-delay: 2s; }
.zoom-ring:nth-child(6)  { animation-delay: 2.5s; }
.zoom-ring:nth-child(7)  { animation-delay: 3s; }
.zoom-ring:nth-child(8)  { animation-delay: 3.5s; }
.zoom-ring:nth-child(9)  { animation-delay: 4s; }
.zoom-ring:nth-child(10) { animation-delay: 4.5s; }
.zoom-ring:nth-child(11) { animation-delay: 5s; }
.zoom-ring:nth-child(12) { animation-delay: 5.5s; }

@keyframes zoomIn {
  0% {
    width: 40px; height: 40px;
    opacity: 0;
    border-color: rgba(217, 70, 239, .35);
    transform: translateZ(-200px) rotate(45deg);
  }
  15% { opacity: .45; }
  70% { opacity: .1; }
  100% {
    width: 280vmax; height: 280vmax;
    opacity: 0;
    border-color: rgba(124, 58, 237, .02);
    transform: translateZ(120px) rotate(45deg);
  }
}

/* ============ ORBES 3D CON DESTELLOS ============ */
.scene {
  position: fixed;
  inset: -10%;
  z-index: 0;
  overflow: hidden;
  will-change: transform;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform, filter;
}

.orb--1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  top: -5%; left: -5%;
  animation: orbit1 14s ease-in-out infinite, flare1 5.5s ease-in-out infinite;
}

.orb--2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--magenta), transparent 70%);
  bottom: -8%; right: -4%;
  animation: orbit2 12s ease-in-out infinite, flare2 7s ease-in-out infinite 1.2s;
}

.orb--3 {
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--violet), transparent 70%);
  top: 30%; left: 55%;
  animation: orbit3 16s ease-in-out infinite, flare3 6.2s ease-in-out infinite 2.4s;
}

.orb--4 {
  width: 170px; height: 170px;
  background: radial-gradient(circle, var(--fuchsia), transparent 70%);
  top: 60%; left: 15%;
  animation: orbit4 10s ease-in-out infinite, flare1 8s ease-in-out infinite .6s;
  opacity: .6;
}

@keyframes orbit1 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(80px, 60px) scale(1.15); }
  50%  { transform: translate(30px, 120px) scale(.95); }
  75%  { transform: translate(-40px, 50px) scale(1.1); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes orbit2 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(-70px, -50px) scale(1.1); }
  50%  { transform: translate(-30px, -100px) scale(.9); }
  75%  { transform: translate(50px, -40px) scale(1.15); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes orbit3 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-90px, 70px) scale(1.2); }
  66%  { transform: translate(60px, -50px) scale(.85); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes orbit4 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(100px, -80px) scale(1.3); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Destellos sutiles: la luz sube de intensidad y vuelve a la normalidad */
@keyframes flare1 {
  0%, 82%, 100% { filter: blur(70px) brightness(1); }
  90%           { filter: blur(60px) brightness(1.6); }
}

@keyframes flare2 {
  0%, 88%, 100% { filter: blur(70px) brightness(1); }
  94%           { filter: blur(58px) brightness(1.7); }
}

@keyframes flare3 {
  0%, 85%, 100% { filter: blur(70px) brightness(1); }
  92%           { filter: blur(62px) brightness(1.5); }
}

/* ============ VIGNETTE + SPOTLIGHT DE CURSOR ============ */
.vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--black) 78%);
  z-index: 0;
  pointer-events: none;
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --sx: 50vw;
  --sy: 50vh;
  background: radial-gradient(280px circle at var(--sx) var(--sy), rgba(168, 85, 247, .10), transparent 70%);
  transition: opacity .3s ease;
}

/* ============ CONTENIDO ============ */
.content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) both;
  transition: transform .25s ease-out;
  will-change: transform;
}

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

.logo-wrap {
  position: relative;
  width: 160px;
  margin-bottom: 2.5rem;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .2s both;
  cursor: pointer;
  outline: none;
}

.logo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 24px rgba(168, 85, 247, .35));
  transition: transform .9s ease, filter .9s ease;
  will-change: transform;
}

.logo-wrap:hover img,
.logo-wrap:focus-visible img {
  transform: scale(1.06);
  filter: drop-shadow(0 0 28px rgba(168, 85, 247, .45));
}

.line-accent {
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--purple), var(--magenta));
  margin-bottom: 2.25rem;
  position: relative;
  overflow: hidden;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .35s both;
}

.line-accent::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 2.2s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

h1 {
  font-size: clamp(1.5rem, 4.2vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  white-space: nowrap;
  margin-bottom: 1.4rem;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .45s both;
}

h1 .grad {
  background: linear-gradient(135deg, var(--purple), var(--magenta), var(--violet));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 5s ease-in-out infinite;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.subtitle {
  font-size: clamp(.9rem, 2.2vw, 1.1rem);
  font-weight: 300;
  color: rgba(240, 240, 242, .45);
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 2.5rem;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .6s both;
}

.subtitle em {
  font-style: normal;
  color: rgba(240, 240, 242, .88);
  font-weight: 500;
}

/* ============ BOTÓN "TRABAJEMOS JUNTOS" ============ */
.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 2.1rem;
  border-radius: 100px;
  border: 1px solid rgba(168, 85, 247, .4);
  background:
    radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(192, 38, 211, .18));
  color: var(--white);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 2.75rem;
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  transition: box-shadow .35s ease, border-color .35s ease, background-color .35s ease;
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .7s both;
}

.cta::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), var(--purple), var(--magenta), var(--violet), var(--fuchsia), var(--purple));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  to { --angle: 360deg; }
}

.cta:hover,
.cta:focus-visible {
  border-color: transparent;
  box-shadow: 0 0 32px 4px rgba(168, 85, 247, .45), 0 0 70px 10px rgba(192, 38, 211, .25);
}

.cta:hover::before,
.cta:focus-visible::before {
  opacity: 1;
}

.cta .arrow {
  display: inline-flex;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}

.cta:hover .arrow,
.cta:focus-visible .arrow {
  transform: translateX(5px);
}

.cta:active {
  box-shadow: 0 0 18px 2px rgba(168, 85, 247, .5);
}

.ripple {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: rippleFx .6s ease-out forwards;
}

@keyframes rippleFx {
  to {
    transform: translate(-50%, -50%) scale(24);
    opacity: 0;
  }
}

.status {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(240, 240, 242, .35);
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) .85s both;
}

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--violet);
  position: relative;
  flex-shrink: 0;
}

.pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--violet);
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
  0%   { transform: scale(.8); opacity: .7; }
  100% { transform: scale(2.4); opacity: 0; }
}

.tagline {
  position: fixed;
  bottom: 2rem;
  z-index: 1;
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240, 240, 242, .18);
  animation: fadeUp 1s cubic-bezier(.16, 1, .3, 1) 1s both;
}

/* ============ ACCESIBILIDAD / RENDIMIENTO ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  #warp { display: none; }
}

@media (max-width: 600px) {
  h1 {
    white-space: normal;
    font-size: clamp(1.4rem, 7vw, 2.2rem);
  }
  .logo-wrap { width: 120px; }
  .orb--1 { width: 240px; height: 240px; }
  .orb--2 { width: 200px; height: 200px; }
  .orb--3, .orb--4 { display: none; }
  .cta { padding: .9rem 1.7rem; font-size: .88rem; }
}
