/* Header: todo el estilo de la pantalla principal vive en este archivo y no depende de las secciones. */
.hero {
  --night-0: #050524;
  --indigo: #3d3fe0;
  --violet: #6a3df0;
  --lilac: #d9d4ff;
  --display: 'Pixelify Sans', 'Courier New', monospace;
  --ui: 'Silkscreen', 'Courier New', monospace;

  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--night-0);
  color: var(--lilac);
}

/* Lienzo del fondo animado (lo crea js/scene.js dentro del header) */
.hero .hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.hero .hero-inner {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding-block: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: center;
}

.hero .panel {
  position: relative;
  box-sizing: border-box;
  width: min(880px, 100%);
  padding: 40px clamp(18px, 4vw, 40px) 36px;
  background: rgba(7, 7, 48, 0.88);
  border: 3px solid var(--indigo);
  border-radius: 6px;
  box-shadow:
    0 0 0 3px #06062b,
    0 0 34px rgba(82, 70, 255, 0.4),
    inset 0 0 0 3px #14146e;
  animation: hero-rise 0.8s steps(8) both;
}
.hero .corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--violet);
}
.hero .corner.tl { top: -7px; left: -7px; border-top-width: 5px; border-left-width: 5px; }
.hero .corner.tr { top: -7px; right: -7px; border-top-width: 5px; border-right-width: 5px; }
.hero .corner.bl { bottom: -7px; left: -7px; border-bottom-width: 5px; border-left-width: 5px; }
.hero .corner.br { bottom: -7px; right: -7px; border-bottom-width: 5px; border-right-width: 5px; }

.hero h1 {
  margin: 0;
  text-align: center;
  font: 700 clamp(2.3rem, 7.4vw, 5.2rem) / 1.05 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-wrap: balance;
  filter: drop-shadow(0 4px 0 #3a2db0) drop-shadow(0 0 16px rgba(140, 120, 255, 0.4));
  animation: hero-hum 4.5s ease-in-out infinite;
}
.hero h1 .word { display: inline-block; white-space: nowrap; }
.hero h1 .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 15%, #d4ccff 55%, #9b8ef0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: hero-drop 0.5s steps(5) both;
  animation-delay: calc(var(--i) * 45ms + 350ms);
}

.hero .role {
  margin: 14px 0 0;
  text-align: center;
  font: 400 clamp(0.95rem, 2.8vw, 1.6rem) / 1.2 var(--ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #b9b2ff;
  text-shadow: 0 2px 0 #2a2090;
  animation: hero-rise 0.5s steps(5) 1s both;
}

.hero .welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 30px;
  font: 400 clamp(0.95rem, 2.6vw, 1.5rem) / 1 var(--ui);
  letter-spacing: 0.24em;
  color: #6c73f2;
}
.hero .welcome .rule { flex: 1 1 0; max-width: 270px; min-width: 20px; height: 2px; background: var(--indigo); }
.hero .welcome .gem {
  width: 8px;
  height: 8px;
  background: #6c73f2;
  transform: rotate(45deg);
  animation: hero-blink 1.8s steps(2) infinite;
}

.hero .actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  gap: 18px;
}
.hero .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  padding: 16px 20px;
  box-sizing: border-box;
  text-decoration: none;
  color: var(--lilac);
  background: #0a0a47;
  border: 3px solid var(--indigo);
  border-radius: 6px;
  box-shadow: 0 0 0 2px #06062b, inset 0 0 0 2px #12127a;
  font: 400 clamp(0.8rem, 1.6vw, 1rem) / 1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.12s steps(2), background 0.12s steps(2), border-color 0.12s steps(2);
}
.hero .btn svg { flex: none; }
.hero .btn:hover { transform: translateY(-3px); background: #14146a; border-color: #8f8bff; }
.hero .btn:active { transform: translateY(1px); }
.hero .btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #6d3ff5 0%, #4a22cc 100%);
  border-color: #a68bff;
  box-shadow: 0 0 0 2px #06062b, 0 0 20px rgba(130, 90, 255, 0.7), inset 0 0 0 2px rgba(255, 255, 255, 0.14);
  animation: hero-glow 2.6s ease-in-out infinite;
}
.hero .btn.primary:hover { background: linear-gradient(180deg, #8059ff 0%, #5a30e0 100%); border-color: #d4c4ff; }
.hero :focus-visible { outline: 3px dashed #fff; outline-offset: 3px; }

@keyframes hero-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hero-drop { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hero-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes hero-hum {
  0%, 100% { filter: drop-shadow(0 4px 0 #3a2db0) drop-shadow(0 0 12px rgba(140, 120, 255, 0.3)); }
  50% { filter: drop-shadow(0 4px 0 #3a2db0) drop-shadow(0 0 24px rgba(160, 140, 255, 0.6)); }
}
@keyframes hero-glow {
  0%, 100% { box-shadow: 0 0 0 2px #06062b, 0 0 14px rgba(130, 90, 255, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.14); }
  50% { box-shadow: 0 0 0 2px #06062b, 0 0 30px rgba(160, 120, 255, 0.9), inset 0 0 0 2px rgba(255, 255, 255, 0.14); }
}

@media (max-width: 720px) {
  .hero .actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hero *, .hero *::before, .hero *::after { animation: none !important; transition: none !important; }
}
