/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #06040f;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --text: #f1f0f5;
  --muted: rgba(241,240,245,0.45);
  --purple: #a78bfa;
  --blue: #38bdf8;
  --pink: #f472b6;
  --radius: 16px;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safe area for notched phones */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ─── Canvas Particles ──────────────────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ─── Orbs ──────────────────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 12s ease-in-out infinite alternate;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  top: -200px; left: -150px;
  animation-duration: 14s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  bottom: -150px; right: -100px;
  animation-duration: 11s;
  animation-delay: -5s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #db2777, transparent 70%);
  top: 50%; left: 60%;
  animation-duration: 16s;
  animation-delay: -9s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 60px) scale(1.08); }
}

/* ─── Grid Overlay ──────────────────────────────────────────── */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
  z-index: 0;
  pointer-events: none;
}

/* ─── Container ─────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  width: min(720px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  padding: 80px 0 60px;
  padding-bottom: max(60px, env(safe-area-inset-bottom));
  text-align: center;
}

/* ─── Reveal Animation ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  animation: reveal var(--transition) forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.30s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.60s; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Brand ─────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 40px; height: 40px;
  filter: drop-shadow(0 0 12px rgba(167,139,250,0.6));
  animation: pulse-glow 3s ease-in-out infinite;
}
.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(167,139,250,0.5)); }
  50%       { filter: drop-shadow(0 0 22px rgba(56,189,248,0.8)); }
}

/* ─── Hero ──────────────────────────────────────────────────── */
.headline {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: shimmer 4s ease infinite;
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.subheadline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
  max-width: 100%;
}

/* ─── Countdown ─────────────────────────────────────────────── */
.countdown {
  display: flex;
  align-items: center;
  gap: 8px;
}
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 90px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.countdown-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(167,139,250,0.07), rgba(56,189,248,0.07));
  opacity: 0;
  transition: opacity 0.3s;
}
.countdown-item:hover::before { opacity: 1; }
.countdown-item:hover { transform: translateY(-3px); }

.countdown-value {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(135deg, #fff, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.15s ease;
}
.countdown-value.pop {
  transform: scale(1.15);
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 6px;
}
.countdown-sep {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 20px;
  opacity: 0.4;
}

/* ─── Subscribe ─────────────────────────────────────────────── */
.subscribe { width: 100%; max-width: 520px; }
.subscribe-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.subscribe-form { width: 100%; }
.input-wrapper {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.input-wrapper:focus-within {
  border-color: rgba(167,139,250,0.6);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.12), 0 0 30px rgba(167,139,250,0.1);
}
.input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem; /* ≥16px previene zoom en iOS */
  font-family: inherit;
  min-width: 0;
}
.input-wrapper input::placeholder { color: var(--muted); }

.btn-notify {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.25s, transform 0.2s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.btn-notify::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #9f5cf7, #38bdf8);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-notify:hover::before { opacity: 1; }
.btn-notify:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.45);
}
.btn-notify:active { transform: scale(0.97); }
.btn-notify svg { width: 16px; height: 16px; position: relative; z-index: 1; }
.btn-text { position: relative; z-index: 1; }
.btn-icon { position: relative; z-index: 1; transition: transform 0.2s; }
.btn-notify:hover .btn-icon { transform: translateX(3px); }

.form-message {
  margin-top: 12px;
  font-size: 0.85rem;
  height: 1.2em;
  transition: opacity 0.3s;
}
.form-message.success { color: #4ade80; }
.form-message.error   { color: #f87171; }

/* ─── Socials ───────────────────────────────────────────────── */
.socials {
  display: flex;
  gap: 16px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s, border-color 0.3s, transform 0.2s, box-shadow 0.3s;
  backdrop-filter: blur(8px);
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover {
  color: var(--text);
  border-color: rgba(167,139,250,0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(167,139,250,0.25);
}

/* ─── Progress Bar ──────────────────────────────────────────── */
.progress-wrap {
  width: 100%;
  max-width: 400px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.progress-percent { color: var(--purple); font-weight: 600; }

.progress-bar {
  height: 5px;
  background: var(--surface);
  border-radius: 99px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7c3aed, #38bdf8, #f472b6);
  background-size: 200% 100%;
  border-radius: 99px;
  animation: fill-bar 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards,
             bar-shimmer 2.5s linear 2.6s infinite;
}
@keyframes fill-bar {
  from { width: 0; }
  to   { width: var(--target-width, 78%); }
}
@keyframes bar-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ─── Responsive ────────────────────────────────────────────── */

/* Tablet / large phone landscape */
@media (max-width: 768px) {
  .container { gap: 40px; padding-top: 60px; }
  .headline { letter-spacing: -0.025em; }
  .orb-1 { width: 400px; height: 400px; }
  .orb-2 { width: 350px; height: 350px; }
  .orb-3 { width: 280px; height: 280px; }
}

/* Phone */
@media (max-width: 640px) {
  .container {
    gap: 32px;
    padding-top: 48px;
    width: 90vw;
  }

  .brand-name { font-size: 1.25rem; }
  .logo-icon { width: 34px; height: 34px; }

  .subheadline {
    font-size: 1rem;
    line-height: 1.65;
  }
  /* Oculta salto de línea en móvil */
  .subheadline br { display: none; }

  .countdown { gap: 6px; }
  .countdown-item {
    padding: 14px 10px;
    min-width: 72px;
    border-radius: 12px;
  }
  .countdown-sep {
    font-size: 1.8rem;
    margin-bottom: 16px;
  }

  .subscribe { max-width: 100%; }
  .input-wrapper {
    flex-direction: column;
    border-radius: var(--radius);
    padding: 12px;
    gap: 10px;
  }
  .input-wrapper input {
    padding: 10px 4px;
    text-align: center;
  }
  .btn-notify {
    width: 100%;
    justify-content: center;
    padding: 14px 22px;
    font-size: 1rem;
  }

  .social-link {
    width: 48px;
    height: 48px; /* touch target cómodo */
  }

  .progress-wrap { max-width: 100%; }

  .orb-1 { width: 280px; height: 280px; top: -100px; left: -80px; }
  .orb-2 { width: 240px; height: 240px; bottom: -80px; right: -60px; }
  .orb-3 { display: none; } /* reduce GPU en móvil */
}

/* Small phone (≤390px — iPhone SE, Galaxy A series) */
@media (max-width: 390px) {
  .container { gap: 26px; padding-top: 40px; width: 94vw; }

  .headline { line-height: 1.08; margin-bottom: 14px; }

  /* Countdown en grid 2×2 */
  .countdown {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: center;
    gap: 6px 4px;
    width: 100%;
  }
  .countdown-item:nth-child(1) { grid-column: 1; grid-row: 1; }
  .countdown-sep:nth-child(2)  { grid-column: 2; grid-row: 1; }
  .countdown-item:nth-child(3) { grid-column: 3; grid-row: 1; }
  .countdown-sep:nth-child(4)  { grid-column: 2; grid-row: 2; }
  .countdown-item:nth-child(5) { grid-column: 1; grid-row: 2; }
  .countdown-sep:nth-child(6)  { display: none; }
  .countdown-item:nth-child(7) { grid-column: 3; grid-row: 2; }

  .countdown-item { min-width: 0; width: 100%; padding: 12px 8px; }
  .countdown-sep { font-size: 1.4rem; margin-bottom: 0; }

  .subscribe-label { font-size: 0.82rem; }
  .form-message { font-size: 0.8rem; }

  .brand-name { font-size: 1.1rem; }
  .logo-icon { width: 30px; height: 30px; }
}

/* Landscape phone — evita que el contenido quede cortado */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    gap: 20px;
    padding-top: 30px;
    padding-bottom: max(30px, env(safe-area-inset-bottom));
  }
  .orb-1, .orb-2, .orb-3 { opacity: 0.2; }
  .headline { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 10px; }
  .subheadline { font-size: 0.9rem; line-height: 1.5; }
  .subheadline br { display: none; }
  .countdown-item { padding: 10px 8px; min-width: 60px; }
  .countdown-sep { font-size: 1.4rem; margin-bottom: 10px; }
}

/* Accesibilidad: reduce movimiento */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .orb { animation: none; }
  .gradient-text { animation: none; }
  .progress-fill { animation: none; width: var(--target-width, 78%); }
  .logo-icon { animation: none; }
  #particles { display: none; }
}
