/* Reset y base */
* { box-sizing: border-box; }
html, body { height: 100%; }
:root {
  --hue: 220;
  --bg-1: hsl(var(--hue) 30% 8%);
  --bg-2: hsl(calc(var(--hue) + 10) 25% 5%);
  --text: hsl(var(--hue) 15% 92%);
  --muted: hsl(var(--hue) 10% 70%);
  --accent: hsl(calc(var(--hue) + 60) 90% 58%);
  --accent-2: hsl(calc(var(--hue) + 120) 90% 58%);
  --card-bg: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.12);
  --blur: 18px;
  --radius: 18px;
  --shadow: 0 30px 80px hsl(var(--hue) 40% 10% / 0.55);
}

@property --hue {
  syntax: '<number>';
  inherits: true;
  initial-value: 220;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  /* Fallback sólido por si un gradiente falla */
  background-color: #0a0c12;
  /* Gradientes corregidos */
  background:
    radial-gradient(800px 500px at 15% 10%, hsl(calc(var(--hue) + 40) 80% 60% / .08), transparent 55%),
    radial-gradient(900px 600px at 85% 90%, hsl(calc(var(--hue) + 290) 80% 55% / .08), transparent 60%),
    linear-gradient(to bottom, var(--bg-1), var(--bg-2));
  min-height: 100%;
  overflow: hidden;
  animation: hueShift 20s linear infinite;
}

@keyframes hueShift {
  0%   { --hue: 220; }
  50%  { --hue: 340; }
  100% { --hue: 580; }
}

.container {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}

#orbs {
  position: fixed;
  inset: 0;
  z-index: 1;
  filter: blur(24px) saturate(120%);
  opacity: 0.8;
}

/* Tarjeta principal */
.card {
  width: min(920px, 92vw);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: saturate(140%) blur(var(--blur));
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  user-select: none;
}
.logo .brand {
  font-weight: 800;
  letter-spacing: .02em;
  font-size: 1.05rem;
  opacity: .95;
}

/* Glitch title */
.glitch {
  position: relative;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  margin: 8px 0 12px;
  text-shadow:
    0 2px 8px hsl(var(--hue) 90% 30% / .35),
    0 20px 60px hsl(var(--hue) 50% 20% / .5);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
  mix-blend-mode: screen;
  animation: glitchMove 2.2s infinite cubic-bezier(.2,.6,.4,1);
}
.glitch::before {
  color: var(--accent);
  clip-path: inset(0 0 40% 0);
  transform: translate(-1px, 1px);
}
.glitch::after {
  color: var(--accent-2);
  clip-path: inset(60% 0 0 0);
  transform: translate(1px, -1px);
}

@keyframes glitchMove {
  0%   { transform: translate(0,0); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
  20%  { transform: translate(-1px, 1px); }
  40%  { transform: translate(1px, -1px); }
  60%  { transform: translate(-1px, -1px); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0,0); }
}

.sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: clamp(.98rem, 2.3vw, 1.15rem);
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 10px 0 24px;
}
.slot {
  position: relative;
  padding: 14px 12px;
  text-align: center;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.slot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 40px hsl(var(--hue) 80% 60% / .08);
  pointer-events: none;
}
.num {
  display: block;
  font-feature-settings: "tnum" on, "lnum" on;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(1.5rem, 6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: .04em;
}
.label {
  display: block;
  margin-top: 4px;
  font-size: .8rem;
  color: var(--muted);
}

/* Form */
.subscribe {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.subscribe input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}
.subscribe input::placeholder { color: hsl(var(--hue) 10% 65%); }
.subscribe input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px hsl(calc(var(--hue) + 60) 90% 58% / .18);
}
.button {
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  color: white;
  font-weight: 700;
  letter-spacing: .02em;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 8px 20px hsl(calc(var(--hue) + 60) 90% 40% / .35),
    inset 0 -6px 12px hsl(calc(var(--hue) + 100) 80% 40% / .4);
  transition: transform .12s ease, box-shadow .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(.99); }
.hint {
  grid-column: 1 / -1;
  margin: 4px 2px 0;
  font-size: .85rem;
  color: var(--muted);
}

/* Socials */
.socials {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.socials a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  color: var(--text);
  opacity: .85;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.socials a:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px hsl(var(--hue) 60% 20% / .35);
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: .9rem;
}

/* Tilt 3D */
.tilt { will-change: transform; }

/* Confetti */
.confetti {
  position: fixed;
  top: -12px;
  width: 8px; height: 14px;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
  opacity: .95;
  transform: translate3d(0,0,0);
  animation: fall 3.5s ease-in forwards;
}
@keyframes fall {
  to { transform: translate3d(var(--x), 110vh, 0) rotate(var(--r)); opacity: .9; }
}

/* A11y */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }
  .subscribe {
    grid-template-columns: 1fr;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .glitch::before, .glitch::after { animation: none; }
  .confetti { animation: none; }
}

/* Forzar ocultación cuando haya atributo hidden */
[hidden] { display: none !important; }