/* ==========================================
   KUSH — Mood Archetype Engine
   Dark meditative holographic aesthetic
   ========================================== */

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

:root {
  --bg-deep: #0d0619;
  --bg-primary: #1a0a2e;
  --bg-secondary: #2d1654;
  --bg-card: rgba(45, 22, 84, 0.5);
  --bg-card-hover: rgba(45, 22, 84, 0.8);
  --text-primary: #e8e0f0;
  --text-secondary: #a89bc2;
  --text-muted: #7a6b94;
  --accent-1: #c4b5fd;
  --accent-2: #a78bfa;
  --accent-3: #8b5cf6;
  --border: rgba(139, 92, 246, 0.15);
  --border-hover: rgba(139, 92, 246, 0.35);
  --glow: rgba(139, 92, 246, 0.3);
  --font-heading: 'Press Start 2P', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Background Canvas --- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.hero-inner {
  max-width: 640px;
}

.logo-wrap {
  margin-bottom: 1.5rem;
  animation: fadeInDown 1.2s var(--ease-out) both;
}

.logo-svg {
  width: 320px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
}

.tagline {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 1.5rem;
  animation: fadeIn 1.4s var(--ease-out) 0.3s both;
}

.description {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.8;
  max-width: 480px;
  margin: 0 auto 2.5rem;
  animation: fadeIn 1.4s var(--ease-out) 0.5s both;
}

/* --- CTA Button --- */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-heading);
  font-size: 0.55rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  animation: fadeIn 1.4s var(--ease-out) 0.7s both;
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}

.cta-btn:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2), inset 0 0 30px rgba(139, 92, 246, 0.05);
  transform: translateY(-1px);
}

.cta-btn:hover::before {
  opacity: 1;
}

.cta-btn span, .cta-btn svg {
  position: relative;
  z-index: 1;
}

/* --- Section Headings --- */
.section-heading {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-1);
  text-align: center;
  margin-bottom: 0.75rem;
}

/* --- Archetypes Section --- */
.archetypes-section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.archetypes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.archetype-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  overflow: hidden;
  transition: all 0.5s var(--ease-out);
  cursor: default;
}

.archetype-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.card-aura {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--aura) 0%, transparent 70%);
  opacity: 0.15;
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}

.archetype-card:hover .card-aura {
  opacity: 0.35;
}

.card-content {
  position: relative;
  z-index: 1;
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  filter: grayscale(0.3);
}

.card-name {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--aura);
  margin-bottom: 0.5rem;
}

.card-tone {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 0.75rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
}

/* --- Discovery Section --- */
.discover-section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem 8rem;
  max-width: 1200px;
  margin: 0 auto;
}

.discover-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 0.95rem;
  margin-bottom: 3rem;
}

.discover-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.discover-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Sliders --- */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label {
  font-size: 0.7rem;
  font-family: var(--font-heading);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.slider-value {
  font-family: 'Inter', monospace;
  font-size: 0.85rem;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.mood-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-secondary) 100%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  position: relative;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-3);
  border: 2px solid var(--accent-1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.2s;
}

.mood-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  transform: scale(1.15);
}

.mood-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-3);
  border: 2px solid var(--accent-1);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
  cursor: pointer;
}

/* --- Choice Buttons --- */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.choice-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.choice-btn {
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(45, 22, 84, 0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.choice-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

.choice-btn.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-3);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

/* --- Discover CTA --- */
.discover-cta {
  align-self: flex-start;
  margin-top: 0.5rem;
  animation: none;
}

/* --- Result Panel --- */
.discover-result {
  position: relative;
  min-height: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#aura-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.result-content {
  position: relative;
  z-index: 1;
  padding: 2.5rem;
  width: 100%;
  text-align: center;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.placeholder-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  animation: orbPulse 3s ease-in-out infinite;
  opacity: 0.5;
}

.result-placeholder p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.result-placeholder p strong {
  color: var(--accent-2);
}

/* --- Result Display --- */
.result-archetype {
  animation: resultReveal 0.8s var(--ease-out) both;
}

.result-archetype .result-aura-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 30px var(--result-aura);
}

.result-archetype .result-tone {
  font-size: 0.65rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.result-archetype .result-description {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.result-archetype .result-divider {
  width: 40px;
  height: 1px;
  background: var(--border-hover);
  margin: 0 auto 1.5rem;
}

.result-archetype .result-ritual-label {
  font-family: var(--font-heading);
  font-size: 0.45rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.result-archetype .result-ritual {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.result-archetype .result-building-label {
  font-family: var(--font-heading);
  font-size: 0.45rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-archetype .result-building {
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 500;
  text-transform: capitalize;
}

.result-deltas {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.delta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

.delta-tag.positive {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.delta-tag.negative {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 0.45rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-attribution {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-attribution:hover {
  color: var(--accent-2);
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

@keyframes resultReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auraBreath {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

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

  .discover-container {
    grid-template-columns: 1fr;
  }

  .discover-result {
    min-height: 420px;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 90vh;
    padding: 2rem 1.25rem;
  }

  .logo-svg {
    width: 260px;
  }

  .tagline {
    font-size: 0.5rem;
    letter-spacing: 4px;
  }

  .description {
    font-size: 0.9rem;
  }

  .section-heading {
    font-size: 0.6rem;
    letter-spacing: 2px;
  }

  .archetypes-section {
    padding: 4rem 1.25rem;
  }

  .archetypes-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .archetype-card {
    padding: 1.25rem 1rem;
  }

  .discover-section {
    padding: 4rem 1.25rem 6rem;
  }

  .discover-subtitle {
    font-size: 0.85rem;
  }

  .choice-options {
    gap: 0.35rem;
  }

  .choice-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.7rem;
  }

  .result-content {
    padding: 1.5rem;
  }

  .result-archetype .result-aura-name {
    font-size: 0.9rem;
    letter-spacing: 4px;
  }

  .cta-btn {
    font-size: 0.5rem;
    padding: 0.75rem 1.5rem;
  }
}

/* --- Selection & Scrollbar --- */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-3);
}
