/* ===== xAI Theme Docs ===== */
/* Source: Inspired by grok.x.ai (dark #000421 bg, #00D4FF blue accents).
   Responsive: Mobile-first (clamp/media queries). Animations: CSS keyframes for 60fps.
   A11y: High contrast (WCAG AA), reduced motion query, focus rings.
   License: MIT (public domain-ish). Minify for prod: cssminifier.com */

/* Reset & Base – Normalize for cross-browser */
* { margin: 0; padding: 0; box-sizing: border-box; } /* Box-sizing: consistent sizing */
body {
  font-family: 'Inter', sans-serif; /* Source: Google Fonts – lightweight, xAI-like clean */
  background: linear-gradient(135deg, #000421 0%, #0a0a0a 100%); /* Cosmic dark: subtle xAI space vibe */
  color: #fff; /* High contrast white */
  line-height: 1.6; /* Readable spacing */
  overflow-x: hidden; /* No horiz scroll */
}

/* Utility: Container – Max-width for readability */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Hero: Full-screen intro; flex center */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: radial-gradient(circle at center, rgba(0,212,255,0.1) 0%, transparent 70%); /* Subtle blue glow */
}
.hero h1 { font-size: clamp(3rem, 8vw, 6rem); font-weight: 300; margin-bottom: 1rem; letter-spacing: -0.02em; } /* Fluid text: scales mobile/desktop */
.hero p { font-size: 1.2rem; max-width: 600px; margin: 0 auto 2rem; opacity: 0.9; } /* Faded for depth */
.cta {
  display: inline-block; padding: 1rem 2rem; background: #00D4FF; color: #000; /* Blue bg, black text: 14:1 contrast */
  text-decoration: none; border-radius: 50px; font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hovers */
}
.cta:hover, .cta:focus-visible { /* A11y: Focus for keyboard */
  transform: scale(1.05); box-shadow: 0 0 20px rgba(0,212,255,0.5); outline: 2px solid #00D4FF; /* Visible ring */
}

/* Links: Padded section; grid layout */
.links { padding: 4rem 0; }
.links h2 { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; opacity: 0.8; } /* Subtle header */
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; /* Responsive: 1col mobile, 3col desktop */
}
.card {
  display: flex; align-items: center; justify-content: center; padding: 2rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(0,212,255,0.2); border-radius: 12px;
  text-decoration: none; color: #fff; font-size: 1.1rem;
  transition: all 0.3s ease; backdrop-filter: blur(10px); /* Glassmorphism: xAI modern */
}
.card:hover, .card:focus-visible {
  background: rgba(0,212,255,0.1); border-color: #00D4FF; transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,212,255,0.2); outline: 2px solid #00D4FF; /* Hover + focus */
}

/* Rewards: Centered gen tool */
.rewards { padding: 4rem 0; text-align: center; background: rgba(0,0,0,0.3); } /* Subtle sep */
.rewards h2 { margin-bottom: 1rem; }
#genPortrait { padding: 1rem 2rem; background: #00D4FF; color: #000; border: none; border-radius: 50px; font-size: 1.1rem; cursor: pointer; transition: all 0.3s; }
#genPortrait:hover, #genPortrait:focus-visible { transform: scale(1.05); box-shadow: 0 0 20px rgba(0,212,255,0.5); outline: 2px solid #fff; } /* Interactive */
.hidden { display: none; } /* Utility: Toggle visibility */
#portraitCanvas { border: 1px solid #00D4FF; border-radius: 8px; margin-top: 1rem; } /* Visual feedback */

.message-display { text-align: center; padding: 2rem; background: rgba(0,212,255,0.1); border-radius: 12px; }
.message-display h3 { color: #00D4FF; margin-bottom: 1rem; }
.message-display p { font-size: 1.2rem; font-style: italic; margin-bottom: 1rem; line-height: 1.5; }
#copyBtn { padding: 0.5rem 1rem; background: #00D4FF; color: #000; border: none; border-radius: 4px; cursor: pointer; }

/* Form: Inline, responsive inputs */
#inputForm { display: flex; flex-direction: column; gap: 1rem; max-width: 400px; margin: 0 auto 2rem; }
#inputForm label { font-weight: 600; color: #00D4FF; }
#inputForm input { padding: 0.5rem; background: rgba(255,255,255,0.1); border: 1px solid #00D4FF; border-radius: 4px; color: #fff; }
#inputForm input::placeholder { color: rgba(255,255,255,0.6); }

/* Thumbs: 3-col grid on desktop, stack mobile */
.thumbs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 1rem; max-width: 400px; margin: 2rem auto; }
.thumb-canvas { border: 2px solid #00D4FF; border-radius: 8px; cursor: pointer; transition: transform 0.3s; width: 100px; height: 100px; }
.thumb-canvas:hover, .thumb-canvas:focus-visible { transform: scale(1.1); outline: 2px solid #fff; }
.thumb-label { text-align: center; font-size: 0.9rem; margin-top: 0.5rem; }

/* Footer: Bottom credit */
footer { text-align: center; padding: 2rem; background: rgba(0,0,0,0.5); opacity: 0.7; }

/* Responsive: Media queries for breakpoints */
@media (max-width: 768px) {
  .hero { min-height: 80vh; padding-top: 2rem; } /* Shorter on mobile */
  .grid { grid-template-columns: 1fr; gap: 1rem; } /* Stack cards */
  .links, .rewards { padding: 2rem 0; } /* Reduce padding */
}

/* A11y: Respect user prefs */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } /* No motion for vestibular */
}

/* Animations: CSS-only for speed; staggered fades */
.fade-in { opacity: 0; transform: translateY(30px); animation: fadeInUp 1s ease forwards; }
.fade-in:nth-child(1) { animation-delay: 0.2s; }
.fade-in:nth-child(2) { animation-delay: 0.4s; }
.fade-in:nth-child(3) { animation-delay: 0.6s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } } /* Smooth entry: xAI subtle */

/* Particles: Fixed bg graphics – low CPU */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.particle {
  position: absolute; background: #00D4FF; border-radius: 50%;
  animation: float 6s ease-in-out infinite; /* Infinite loop: cosmic drift */
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); } /* Gentle bob/rotate */
}

/* Sources: Gradients from xAI palette (public); Inter via Google (free, Apache 2.0). */