/* ============================================================================
   SimZilla SSR — Design System
   ============================================================================
   Plain CSS — 397 lines, custom properties, edit and refresh.
   The class names mirror Tailwind conventions so the EJS templates
   read naturally, but everything is hand-written CSS custom properties.
   ============================================================================ */

/* ── Design Tokens ── */
:root {
  /* Dark Backgrounds & Scales */
  --background: #0B0F14;
  --foreground: #FFFFFF;
  --surface: #1A1F28;
  --surface-hover: #2A2F3A;

  /* Neon Blues & Accents */
  --primary: #008BFF;
  --primary-dim: #0076D6;
  --accent: #00E5FF;
  --success: #39FF14;
  --warning: #FFB800;
  --danger: #FF3366;
  --muted: #8A99AD;
  --border-subtle: rgba(255, 255, 255, 0.06);

  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); color: var(--foreground); background: var(--background); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ── Typography ── */
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.text-foreground { color: var(--foreground); }
.text-foreground\/70 { color: rgba(240, 244, 248, 0.7); }

/* ── Backgrounds ── */
.bg-background { background-color: var(--background); }
.bg-background\/95 { background-color: rgba(10, 10, 15, 0.95); }
.bg-surface { background-color: var(--surface); }
.bg-surface\/50 { background-color: rgba(20, 20, 31, 0.5); }
.bg-black\/30 { background-color: rgba(0, 0, 0, 0.3); }
.bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }
.bg-primary\/5 { background-color: rgba(0, 229, 255, 0.05); }
.bg-primary\/10 { background-color: rgba(0, 229, 255, 0.1); }
.bg-primary\/20 { background-color: rgba(0, 229, 255, 0.2); }
.bg-success\/20 { background-color: rgba(0, 255, 136, 0.2); }
.bg-danger\/10 { background-color: rgba(255, 51, 102, 0.1); }
.bg-danger\/20 { background-color: rgba(255, 51, 102, 0.2); }

/* ── Borders ── */
.border { border: 1px solid var(--border-subtle); }
.border-t { border-top: 1px solid var(--border-subtle); }
.border-b { border-bottom: 1px solid var(--border-subtle); }
.border-primary\/20 { border-color: rgba(0, 229, 255, 0.2); }
.border-primary\/30 { border-color: rgba(0, 229, 255, 0.3); }
.border-primary\/50 { border-color: rgba(0, 229, 255, 0.5); }
.border-danger\/20 { border-color: rgba(255, 51, 102, 0.2); }
.border-border-subtle { border-color: var(--border-subtle); }

/* ── Layout ── */
.container { width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.hidden { display: none; }
.inline-block { display: inline-block; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.col-span-2 { grid-column: span 2; }

@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:col-span-1 { grid-column: span 1; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Spacing ── */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-6 { padding-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-20 { margin-top: 5rem; }
.mr-4 { margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Sizing ── */
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-xs { max-width: 20rem; }
.max-w-xl { max-width: 36rem; }
.min-h-screen { min-height: 100vh; }
.shrink-0 { flex-shrink: 0; }

/* ── Typography Sizes ── */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-8xl { font-size: 6rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.625; }
.italic { font-style: italic; }
.list-none { list-style: none; }
.list-disc { list-style: disc; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Rounded ── */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ── Effects ── */
.backdrop-blur-md { backdrop-filter: blur(12px); }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-transform { transition: transform 0.2s ease; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.group-open\:rotate-180:open { transform: rotate(180deg); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── Positioning ── */
.sticky { position: sticky; top: 0; }
.z-50 { z-index: 50; }

/* ── Components ── */
.card {
  background-color: var(--surface);
  border: 1px solid var(--surface-hover);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--primary);
  color: var(--foreground);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--primary-dim);
  box-shadow: 0 0 15px rgba(0, 139, 255, 0.5);
}
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-decoration: none;
}
.btn-ghost:hover { color: var(--primary); }

.input {
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
  outline: none;
}
.input:focus { border-color: rgba(0, 229, 255, 0.5); }
.input::placeholder { color: rgba(142, 142, 147, 0.5); }

/* ── Has-checked trick for radio cards ── */
.has-\[\:checked\]\:border-primary\/50:has(:checked) { border-color: rgba(0, 229, 255, 0.5); }
.has-\[\:checked\]\:bg-primary\/5:has(:checked) { background-color: rgba(0, 229, 255, 0.05); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── Hover effects ── */
.hover\:text-primary:hover { color: var(--primary); }
.hover\:border-primary\/30:hover { border-color: rgba(0, 229, 255, 0.3); }
.group:hover .group-hover\:text-primary { color: var(--primary); }

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ── Selection ── */
::selection { background: rgba(0, 229, 255, 0.25); color: var(--foreground); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dim); }

/* ── Prose (for legal pages) ── */
.prose h2 { margin-top: 2rem; margin-bottom: 1rem; }
.prose p { margin-bottom: 1rem; line-height: 1.625; }
.prose ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.5rem; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Giant Mascot Hero (homepage) ── */
.mascot-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.mascot-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,139,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.mascot-img {
  width: min(380px, 65vw);
  height: auto;
  filter: drop-shadow(0 0 80px rgba(0,139,255,0.5)) drop-shadow(0 0 30px rgba(0,229,255,0.3));
  animation: mascot-float 4s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  z-index: 1;
}
@keyframes mascot-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -14px, 0) scale(1.03); }
}
.mascot-brand {
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.9;
  text-align: center;
  z-index: 1;
  margin-top: -0.2em;
}
.mascot-brand span { color: var(--primary); }
.mascot-motto {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  z-index: 1;
}
.mascot-tagline {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 600px;
  text-align: center;
  margin-top: 1.5rem;
  z-index: 1;
  line-height: 1.6;
}
.mascot-cta {
  margin-top: 2.5rem;
  z-index: 1;
}
.mascot-strip {
  background: var(--primary);
  color: var(--foreground);
  text-align: center;
  padding: 1.5rem;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── Mascot system (header/footer) ── */
.mascot-header {
  width: 48px;
  height: 48px;
  opacity: 0.6;
}
.mascot-footer {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

/* ── Mascot waiting (checkout / loading states) ── */
.mascot-waiting {
  width: min(200px, 50vw);
  height: auto;
  opacity: 0.7;
  filter: drop-shadow(0 0 30px rgba(0,139,255,0.3));
  animation: mascot-float 5s ease-in-out infinite;
}
