/* ═══════════════════════════════════════════════════════════════
   main.css — Archivo Gatirena: Design System & Base Styles
   Heredado del Protocolo Gatirena: rosa cálido, tierno, nerd suave
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts (matching Protocolo Gatirena + PRD extras) ── */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Sacramento&family=Space+Mono:wght@400;700&family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Design Tokens — Protocolo Gatirena DNA ── */
:root {
  /* Backgrounds: warm pink tints, not black */
  --bg-base:          hsl(340, 80%, 96%);
  --bg-surface:       hsl(340, 60%, 93%);
  --bg-card:          #ffffff;
  --bg-card-hover:    hsl(340, 50%, 97%);
  --bg-celebration:   linear-gradient(160deg, #fdf2f8, #fce7f3 30%, #fbcfe8 55%, #fce7f3 80%, #fdf2f8);

  /* Accent colors: Protocolo Gatirena palette */
  --pink-400:         #ff8fab;
  --pink-500:         #ff6b8a;
  --pink-600:         #ff4d6d;
  --rose:             #c9184a;
  --rose-light:       #ffb3c6;
  --accent-gradient:  linear-gradient(135deg, #ff6b8a, #ff4d6d);
  --accent-soft:      linear-gradient(135deg, #ff8fab, #ff6b8a);

  /* Text */
  --text-primary:     #7c1d3e;
  --text-body:        #5a3048;
  --text-muted:       #b07090;
  --text-dim:         #c4899e;
  --text-on-accent:   #ffffff;

  /* Borders & glows */
  --border-subtle:    rgba(255, 107, 138, 0.2);
  --border-active:    rgba(255, 77, 109, 0.5);
  --glow-primary:     0 5px 22px rgba(255, 77, 109, 0.3);
  --glow-secondary:   0 5px 32px rgba(255, 77, 109, 0.5), 0 0 45px rgba(255, 107, 138, 0.15);
  --glow-card:        0 4px 24px rgba(255, 107, 138, 0.1);

  /* Radii */
  --radius-card:      20px;
  --radius-btn:       50px;
  --radius-sm:        12px;

  /* Transitions */
  --ease:             cubic-bezier(.34, 1.56, .64, 1);
  --ease-s:           cubic-bezier(.4, 0, .2, 1);
  --transition-base:  0.3s var(--ease-s);
  --transition-bounce: 0.5s var(--ease);

  /* Fonts */
  --font-display:     'Quicksand', 'Space Grotesk', sans-serif;
  --font-body:        'Quicksand', 'Inter', sans-serif;
  --font-mono:        'Space Mono', monospace;
  --font-sig:         'Sacramento', cursive;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.8s ease;
}

/* ── Decorative Background Cats ── */
.bg-cats {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bg-cat {
  position: absolute;
}
.bg-cat-1 {
  width: 140px; bottom: 8%; left: 3%;
  animation: catFloat 8s ease-in-out infinite alternate;
}
.bg-cat-2 {
  width: 50px; top: 12%; right: 8%;
  animation: catFloat 6s ease-in-out 1s infinite alternate;
}
.bg-cat-3 {
  width: 90px; top: 45%; right: 3%;
  animation: catFloat 10s ease-in-out 2s infinite alternate;
}
.bg-cat-4 {
  width: 45px; bottom: 25%; right: 12%;
  animation: catFloat 7s ease-in-out 3s infinite alternate;
  transform: rotate(-15deg);
}
@keyframes catFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(2deg); }
}
@media (max-width: 600px) {
  .bg-cat-1 { width: 100px; bottom: 5%; left: 2%; }
  .bg-cat-2 { width: 35px; }
  .bg-cat-3 { width: 60px; }
  .bg-cat-4 { display: none; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: var(--pink-500);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--pink-600);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Particles Background ── */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── App Container ── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--pink-400); border-radius: 3px; }

/* ── Selection ── */
::selection {
  background: rgba(255, 107, 138, 0.25);
  color: var(--text-primary);
}

/* ── Screen Sections ── */
.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: 80px;
}
.screen.active {
  display: block;
}

/* ── PIN Screen ── */
.pin-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-celebration);
}

.pin-screen .logo-text {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pin-screen .logo-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: catBob 2.5s ease-in-out infinite;
}

@keyframes catBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.pin-screen .subtitle-nerd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.pin-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.pin-input {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 14px 20px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: var(--transition-base);
}

.pin-input:focus {
  border-color: var(--pink-500);
  box-shadow: var(--glow-primary);
  background: rgba(255, 255, 255, 0.9);
}

.pin-input::placeholder {
  color: var(--text-dim);
  letter-spacing: 2px;
  font-size: 14px;
}

.pin-error {
  color: var(--rose);
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
}

/* ── Typography Utils ── */
.text-gradient {
  color: var(--text-primary);
}

.text-pink {
  color: var(--pink-500);
}

.text-rose {
  color: var(--rose);
}

.text-mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-muted);
}

.text-cursive {
  font-family: var(--font-sig);
}

/* ── Section Divider ── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* ── Hero Section ── */
.hero-section {
  text-align: center;
  padding: 60px 20px 40px;
  min-height: 80vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.hero-title {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700; margin-bottom: 8px;
}
.hero-subtitle-nerd {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-dim); margin-bottom: 28px;
}
.hero-intro-text {
  font-size: 15px; line-height: 1.75; color: var(--text-body);
  max-width: 400px; margin: 0 auto 32px;
  font-weight: 500;
}
.hero-cta { max-width: 280px; }

/* ── Countdown Screen ── */
.countdown-container {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; text-align: center; padding: 40px 20px;
}
.countdown-title { font-size: 2rem; margin-bottom: 8px; }
.countdown-subtitle {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-dim); margin-bottom: 40px;
}
.countdown-grid {
  display: flex; gap: 16px; margin-bottom: 32px;
}
.countdown-item { text-align: center; }
.countdown-value {
  font-family: var(--font-display); font-size: 48px; font-weight: 700;
  color: var(--pink-600);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 18px; min-width: 64px;
  box-shadow: var(--glow-card);
}
.countdown-label {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-dim); margin-top: 6px; text-transform: uppercase;
}
.countdown-message {
  font-size: 15px; color: var(--text-muted); max-width: 340px;
}
.countdown-message em { color: var(--pink-600); font-style: normal; font-weight: 700; }

/* ── Closure / Mission Complete ── */
.closure-screen {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60vh;
}
.closure-title {
  font-size: 28px; margin-bottom: 16px;
}
.closure-text {
  font-size: 15px; color: var(--text-body); line-height: 1.7;
  max-width: 380px; margin-bottom: 24px;
}
.closure-secondary {
  font-size: 13px; color: var(--text-dim); margin-top: 16px;
}
.mission-complete-screen {
  background: var(--bg-celebration);
  border-radius: var(--radius-card);
  margin: 20px;
}
.mission-complete-title { font-size: 32px; }
.mission-complete-text {
  font-size: 15px; color: var(--text-body); line-height: 1.8;
  max-width: 380px; margin: 16px auto 32px;
}

/* ── Hidden / Utility ── */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
