:root {
  --cyan: #0097b2;
  --cyan-hover: #0aadca;
  --white: #ffffff;
  --black: #0a0a0a;
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.82);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--black);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.is-booting .navbar,
body.is-booting .page {
  opacity: 0;
}

body.is-ready .navbar {
  animation: boot-bar 1.35s cubic-bezier(0.33, 1, 0.68, 1) both;
}

body.is-ready .page {
  animation: boot-content 1.55s cubic-bezier(0.33, 1, 0.68, 1) 0.15s both;
}

/* —— Grain permanente (efecto VHS suave) —— */
.grain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: grain-shift 0.35s steps(3) infinite;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 3px
  );
  opacity: 0.7;
}

/* —— VHS intro —— */
.vhs {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #050505;
  pointer-events: none;
  overflow: hidden;
  animation: vhs-out 1.6s cubic-bezier(0.4, 0, 0.2, 1) 1.85s forwards;
}

.vhs-noise {
  position: absolute;
  inset: -20%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.22;
  mix-blend-mode: screen;
  animation: vhs-noise 0.12s steps(2) infinite;
}

.vhs-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.06) 0px,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.45;
  animation: vhs-flicker 2.2s linear infinite;
}

.vhs-track {
  position: absolute;
  left: -5%;
  width: 110%;
  height: 18%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 151, 178, 0.18),
    rgba(255, 255, 255, 0.12),
    rgba(0, 151, 178, 0.18),
    transparent
  );
  animation: vhs-track 1.05s linear infinite;
  mix-blend-mode: screen;
}

.vhs-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.85) 100%);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.75);
}

.vhs-hud {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  display: flex;
  justify-content: space-between;
  font-family: "Poppins", monospace, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #c8fff8;
  text-shadow: 0 0 8px rgba(0, 151, 178, 0.8);
  opacity: 0.9;
  animation: vhs-hud-blink 1s steps(1) infinite;
}

.vhs-glitch {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: clamp(1.6rem, 7vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f4fffd;
  white-space: nowrap;
  animation: vhs-glitch-main 2.2s ease both;
}

.vhs-glitch::before,
.vhs-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.85;
}

.vhs-glitch::before {
  color: #00e5ff;
  animation: vhs-rgb-l 0.9s steps(2) infinite;
  clip-path: inset(0 0 55% 0);
}

.vhs-glitch::after {
  color: #ff4d6d;
  animation: vhs-rgb-r 0.85s steps(2) infinite;
  clip-path: inset(45% 0 0 0);
}

@keyframes vhs-noise {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 1%);
  }
  50% {
    transform: translate(1%, -2%);
  }
  75% {
    transform: translate(2%, 2%);
  }
  100% {
    transform: translate(-1%, 0);
  }
}

@keyframes vhs-track {
  from {
    top: -20%;
  }
  to {
    top: 110%;
  }
}

@keyframes vhs-flicker {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.55;
  }
  52% {
    opacity: 0.25;
  }
  54% {
    opacity: 0.6;
  }
}

@keyframes vhs-hud-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.35;
  }
}

@keyframes vhs-glitch-main {
  0% {
    opacity: 0;
    letter-spacing: 0.4em;
    filter: blur(4px);
  }
  18% {
    opacity: 1;
    filter: blur(0);
  }
  22% {
    transform: translate(-52%, -48%) skewX(-8deg);
  }
  26% {
    transform: translate(-48%, -52%) skewX(4deg);
  }
  32%,
  78% {
    transform: translate(-50%, -50%) skewX(0);
    opacity: 1;
  }
  100% {
    opacity: 0;
    letter-spacing: 0.2em;
    filter: blur(2px);
  }
}

@keyframes vhs-rgb-l {
  0%,
  100% {
    transform: translate(0);
  }
  30% {
    transform: translate(-4px, 1px);
  }
  60% {
    transform: translate(3px, -2px);
  }
}

@keyframes vhs-rgb-r {
  0%,
  100% {
    transform: translate(0);
  }
  35% {
    transform: translate(4px, -1px);
  }
  70% {
    transform: translate(-3px, 2px);
  }
}

@keyframes vhs-out {
  0% {
    opacity: 1;
    filter: contrast(1.15) brightness(1);
  }
  40% {
    opacity: 0.55;
    filter: contrast(1.05) brightness(1.05);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    filter: contrast(1) brightness(1.1);
  }
}

@keyframes boot-bar {
  from {
    opacity: 0;
    transform: translateY(-40%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boot-content {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px) saturate(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: none;
  }
}

@keyframes grain-shift {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-1.5%, 1%);
  }
  66% {
    transform: translate(1%, -1%);
  }
  100% {
    transform: translate(0, 0.5%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vhs,
  body.is-ready .navbar,
  body.is-ready .page,
  .grain {
    animation: none !important;
  }

  body.is-booting .navbar,
  body.is-booting .page {
    opacity: 1;
  }

  .vhs {
    display: none;
  }

  .grain {
    opacity: 0.04;
  }
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.78) 100%),
    url("fondo.png") center / cover no-repeat;
}

.navbar {
  background: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  overflow: hidden;
}

.logo {
  display: block;
  height: auto;
}

.logo-nav {
  height: 58px;
  width: auto;
  margin: 0.2rem 0.75rem;
  transform: scale(1);
}

.page {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 2.25rem 0 2rem;
}

.page h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.fecha {
  margin: 0;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.02em;
}

.lead {
  margin: 0;
  max-width: 38rem;
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  line-height: 1.55;
  color: var(--muted);
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--cyan);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--cyan-hover);
}

@media (max-width: 520px) {
  .logo-nav {
    height: 48px;
    margin: 0.15rem 0.5rem;
    transform: none;
  }

  .btn {
    width: 100%;
  }
}

