/* ============================================
   WHAT KIND OF OVERTHINKER ARE YOU?
   Cerebral, calm, slightly dreamy
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #0f0a2e;
  --bg-shift: #1a0e3e;
  --lavender: #b8a9c9;
  --cyan: #7ec8e3;
  --text: #ebe5d9;
  --text-heading: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-shift) 50%, var(--bg-deep) 100%);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

/* ---- Layout ---- */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 60px 0 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
}

.screen.entering {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Ad Containers ---- */
.ad-container {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.ad-container:empty {
  display: none;
}

/* ============================================
   LANDING PAGE
   ============================================ */
.landing-container {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 40px;
  width: 100%;
}

.landing-badge {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 32px;
  opacity: 0.8;
}

.landing-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.15;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.landing-title em {
  font-style: italic;
  color: var(--lavender);
}

.landing-subtitle {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 480px;
  margin: 0 auto 20px;
  opacity: 0.9;
}

.landing-meta {
  font-size: 0.9rem;
  color: var(--lavender);
  opacity: 0.6;
  margin-bottom: 40px;
  line-height: 1.6;
}

/* CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--lavender), var(--cyan));
  border: none;
  padding: 16px 40px;
  border-radius: 60px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 4px 30px rgba(184, 169, 201, 0.25);
  min-height: 54px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(184, 169, 201, 0.35);
}

.cta-button:active {
  transform: translateY(0);
}

/* SEO Section */
.landing-seo {
  margin-top: 60px;
  text-align: left;
  padding-top: 40px;
  border-top: 1px solid var(--glass-border);
}

.landing-seo h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-heading);
  margin-bottom: 16px;
  font-weight: 500;
}

.landing-seo p {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ============================================
   QUIZ SECTION
   ============================================ */
.quiz-container {
  width: 100%;
  padding-top: 20px;
}

/* Progress Dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.5s ease, box-shadow 0.5s ease, transform 0.3s ease;
}

.progress-dot.completed {
  background: var(--lavender);
  box-shadow: 0 0 12px rgba(184, 169, 201, 0.5);
  transform: scale(1.15);
}

.progress-dot.current {
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(126, 200, 227, 0.6);
  transform: scale(1.3);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(126, 200, 227, 0.6); }
  50% { box-shadow: 0 0 24px rgba(126, 200, 227, 0.9); }
}

/* Question */
.question-wrapper {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.question-wrapper.exiting {
  opacity: 0;
  transform: translateY(-30px);
}

.question-wrapper.entering {
  opacity: 0;
  transform: translateY(30px);
}

.question-number {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 16px;
}

.question-text {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4.5vw, 1.65rem);
  font-weight: 500;
  color: var(--text-heading);
  line-height: 1.4;
  margin-bottom: 32px;
  font-style: italic;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 18px 20px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 44px;
}

.option-btn:hover {
  background: var(--glass-hover);
  border-color: rgba(184, 169, 201, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.option-btn:active {
  transform: translateY(0);
}

.option-btn.selected {
  background: rgba(184, 169, 201, 0.12);
  border-color: var(--lavender);
  box-shadow: 0 0 20px rgba(184, 169, 201, 0.15);
}

/* ============================================
   AD INTERSTITIAL
   ============================================ */
.interstitial-container {
  text-align: center;
  width: 100%;
}

.interstitial-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--lavender);
  opacity: 0.7;
  margin-bottom: 24px;
}

.interstitial-loading {
  margin-top: 24px;
}

.interstitial-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--lavender);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   PROCESSING INTERSTITIAL
   ============================================ */
.processing-container {
  text-align: center;
  width: 100%;
}

.processing-svg {
  width: 100%;
  max-width: 400px;
  height: 300px;
  margin: 0 auto 32px;
  display: block;
}

.processing-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--lavender);
  opacity: 0.8;
  transition: opacity 0.4s ease;
}

/* ============================================
   RESULT PAGE
   ============================================ */
.result-container {
  width: 100%;
  padding-top: 20px;
  padding-bottom: 60px;
}

.result-header {
  text-align: center;
  margin-bottom: 40px;
}

.result-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 16px;
}

.result-archetype {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.15;
  margin-bottom: 16px;
}

.result-tagline {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--lavender);
  opacity: 0.85;
}

/* SVG Pattern */
.result-svg-container {
  display: flex;
  justify-content: center;
  margin: 32px 0 40px;
}

.result-svg {
  width: 100%;
  max-width: 300px;
  height: 200px;
}

/* Description */
.result-description {
  margin-bottom: 32px;
}

.result-description p {
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 20px;
  opacity: 0.9;
}

/* Intensity */
.result-intensity {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}

.intensity-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 12px;
}

.intensity-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}

.intensity-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--lavender), var(--cyan));
  transition: width 1.5s ease;
  width: 0;
}

.intensity-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-heading);
}

.intensity-desc {
  font-size: 0.9rem;
  color: var(--lavender);
  opacity: 0.7;
  margin-top: 4px;
}

/* Secondary */
.result-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.secondary-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.7;
  margin-bottom: 8px;
}

.secondary-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.secondary-text {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.7;
}

/* Result Sections */
.result-section {
  margin-bottom: 32px;
}

.result-section h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: 16px;
}

.result-section ul {
  list-style: none;
  padding: 0;
}

.result-section ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.98rem;
  opacity: 0.85;
  line-height: 1.6;
}

.result-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lavender);
  opacity: 0.5;
}

.result-quote {
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.75;
  opacity: 0.85;
  padding-left: 20px;
  border-left: 2px solid rgba(184, 169, 201, 0.3);
}

.result-tip-section p {
  font-size: 1.02rem;
  line-height: 1.8;
  opacity: 0.9;
}

/* Share */
.share-section {
  text-align: center;
  margin: 40px 0 24px;
}

.share-label {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender);
  opacity: 0.6;
  margin-bottom: 16px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.share-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.share-btn:hover {
  background: var(--glass-hover);
  border-color: var(--lavender);
  transform: translateY(-2px);
}

/* Retake */
.retake-button {
  display: flex;
  margin: 0 auto 32px;
  background: transparent;
  color: var(--lavender);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.retake-button:hover {
  background: var(--glass-bg);
  border-color: var(--lavender);
  box-shadow: none;
}

/* Disclaimer */
.disclaimer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--glass-border);
  margin-top: 16px;
}

.disclaimer p {
  font-size: 0.85rem;
  opacity: 0.5;
  line-height: 1.7;
  font-style: italic;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 24px;
  margin-top: 16px;
}

.site-footer a {
  font-size: 0.85rem;
  color: var(--lavender);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.site-footer a:hover {
  opacity: 0.8;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Stagger children */
.result-container > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.result-container > *:nth-child(1) { animation-delay: 0.1s; }
.result-container > *:nth-child(2) { animation-delay: 0.2s; }
.result-container > *:nth-child(3) { animation-delay: 0.3s; }
.result-container > *:nth-child(4) { animation-delay: 0.4s; }
.result-container > *:nth-child(5) { animation-delay: 0.5s; }
.result-container > *:nth-child(6) { animation-delay: 0.6s; }
.result-container > *:nth-child(7) { animation-delay: 0.65s; }
.result-container > *:nth-child(8) { animation-delay: 0.7s; }
.result-container > *:nth-child(9) { animation-delay: 0.75s; }
.result-container > *:nth-child(10) { animation-delay: 0.8s; }
.result-container > *:nth-child(11) { animation-delay: 0.85s; }
.result-container > *:nth-child(12) { animation-delay: 0.9s; }
.result-container > *:nth-child(13) { animation-delay: 0.95s; }
.result-container > *:nth-child(14) { animation-delay: 1.0s; }
.result-container > *:nth-child(15) { animation-delay: 1.05s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .option-btn {
    padding: 16px 18px;
    font-size: 0.94rem;
  }

  .progress-dots {
    gap: 10px;
  }

  .share-btn {
    width: 46px;
    height: 46px;
  }
}

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

  .bg-gradient {
    animation: none;
    background-position: 0% 50%;
  }
}

/* Focus styles */
.cta-button:focus-visible,
.option-btn:focus-visible,
.share-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Selection */
::selection {
  background: rgba(184, 169, 201, 0.3);
  color: var(--text-heading);
}
