/* MindPulseProfile — Mobile-first, neutral, minimal
   Styling: Clean vertical rhythm. Max-width centered layout. Large readable text.
   Smooth section spacing. Bars animate width on render (JS). No heavy animations.
   No emoji. No flashy gradients. Results: skimmable, credible, 2–3 ad slots, archetype at top. */

:root {
  --bg: #f8f7f5;
  --bg-section: #fff;
  --text: #2c2c2c;
  --text-muted: #5a5a5a;
  --border: #e5e3df;
  --accent: #3d6b7a;
  --accent-hover: #2d5563;
  --step-bg: #f0eeeb;
  --max-width: 42rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.content-wrap {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Site nav: Quiz | Insights (dropdown) | How It Works */
.site-nav {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.site-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-nav a:hover {
  color: var(--accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.nav-dropdown-trigger:hover {
  color: var(--accent);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin: var(--space-xs) 0 0;
  padding: var(--space-xs);
  list-style: none;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 12rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
}

.nav-dropdown-menu a:hover {
  background: var(--step-bg);
}

/* Hero */
.hero {
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-subhead {
  margin: 0 0 var(--space-xs);
  font-size: 1.125rem;
  color: var(--text-muted);
}

.hero-trust {
  margin: 0 0 var(--space-lg);
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.cta {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cta:hover {
  background: var(--accent-hover);
}

.cta:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Positioning */
.positioning {
  padding: var(--space-xl) 0;
}

.positioning h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
}

.positioning p {
  margin: 0 0 var(--space-sm);
  color: var(--text-muted);
}

.positioning-tone {
  margin-top: var(--space-md);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
}

/* How it works */
.how-it-works {
  padding: var(--space-xl) 0;
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

.how-it-works h2 {
  margin: 0 0 var(--space-lg);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--step-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.step:last-child {
  margin-bottom: 0;
}

.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-section);
  border-radius: 50%;
  border: 1px solid var(--border);
}

.step-content h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.step-content p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* What you get */
.what-you-get {
  padding: var(--space-xl) 0;
}

.what-you-get h2 {
  margin: 0 0 var(--space-lg);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.modules {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module {
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.module:last-child {
  margin-bottom: 0;
}

.module h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.module p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Quiz placeholder */
.quiz-placeholder {
  padding: var(--space-xl) 0;
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

.quiz-placeholder h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
}

.quiz-intro {
  margin: 0 0 var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.quiz-engine-placeholder {
  min-height: 12rem;
  padding: 0;
  background: transparent;
  border: none;
}

/* ----- Start screen ----- */
.quiz-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--step-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 12rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.quiz-start.quiz-visible {
  opacity: 1;
  pointer-events: auto;
}

.quiz-start-text {
  margin: 0 0 var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

.quiz-cta {
  border: none;
  font-family: inherit;
}

/* ----- Progress ----- */
.quiz-progress-wrap {
  display: none;
  margin-bottom: var(--space-md);
}

.quiz-progress-wrap.quiz-visible {
  display: block;
}

.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.quiz-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xs);
}

.quiz-progress-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.quiz-progress-pct {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ----- Questions wrap ----- */
.quiz-questions-wrap {
  display: none;
  min-height: 18rem;
}

.quiz-questions-wrap.quiz-visible {
  display: block;
}

.quiz-question-anchor {
  scroll-margin-top: 1rem;
}

.quiz-question-inner {
  min-height: 14rem;
}

/* ----- Single question card ----- */
.quiz-q {
  padding: var(--space-lg);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.quiz-q-layout-a {
  text-align: left;
}

.quiz-q-layout-b {
  text-align: left;
  border-left: 3px solid var(--accent);
}

.quiz-q-layout-c {
  text-align: left;
  background: var(--step-bg);
}

.quiz-q {
  opacity: 1;
  transform: translateY(0);
}

.quiz-q-enter {
  opacity: 0;
  transform: translateY(8px);
}

.quiz-q-leave {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.quiz-q-text {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
}

.quiz-q-options {
  margin: 0;
  padding: 0;
  border: none;
}

.quiz-q-options .quiz-option {
  display: block;
  margin-bottom: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.quiz-q-options .quiz-option:hover {
  border-color: var(--accent);
  background: var(--bg-section);
}

.quiz-q-options .quiz-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(61, 107, 122, 0.08);
}

.quiz-option input {
  margin-right: var(--space-sm);
}

.quiz-option-label {
  font-size: 0.9375rem;
  color: var(--text);
}

.quiz-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ----- Overlays: motivation, teaser, analyzing ----- */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(248, 247, 245, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.quiz-overlay.quiz-visible {
  opacity: 1;
  pointer-events: auto;
}

.quiz-overlay-inner {
  max-width: var(--max-width);
  width: 100%;
  padding: var(--space-xl);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.quiz-motivation-text {
  margin: 0 0 var(--space-lg);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quiz-teaser-title {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.quiz-teaser-inner {
  text-align: left;
}

.quiz-teaser-lean,
.quiz-teaser-cognitive {
  margin: 0 0 var(--space-sm);
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quiz-teaser-cognitive {
  margin-bottom: var(--space-lg);
}

.quiz-analyzing-text {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  color: var(--text-muted);
}

.quiz-analyzing-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.quiz-analyzing-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: quiz-dot 0.8s ease-in-out infinite;
}

.quiz-analyzing-dots span:nth-child(2) { animation-delay: 0.15s; }
.quiz-analyzing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes quiz-dot {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

/* ----- Results page container (Phase 2) ----- */
.quiz-results-placeholder {
  display: none;
  padding: 0;
  background: transparent;
}

.quiz-results-placeholder.quiz-visible {
  display: block;
}

#results {
  display: block;
  scroll-margin-top: 1rem;
}

#results .content-wrap {
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Vertical spacing: each section and ad slot get consistent gap */
#results > .result-hero,
#results > .personality-pulse,
#results > .cognitive-strengths,
#results > .work-style,
#results > .growth-edges,
#results > .share-block,
#results > .pdf-teaser {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

#results > .result-hero {
  padding-top: var(--space-lg);
}

#results > .ad-slot {
  min-height: 2rem;
  margin: var(--space-xl) 0;
  padding: 0;
  /* Visually separated from sections above and below */
}

#results > .ad-slot.bottom {
  margin-bottom: var(--space-lg);
}

/* Result hero (dopamine first: H2, subheading, summary) */
.result-hero {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.result-hero-title {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.result-hero-subheading {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.result-hero-summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.result-hero-text {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

/* Section titles and body */
.results-section-title {
  margin: 0 0 var(--space-md);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.results-body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Personality Pulse: trait bars with label + fill + one-sentence summary */
.personality-pulse .trait {
  margin-bottom: var(--space-lg);
}

.personality-pulse .trait:last-child {
  margin-bottom: 0;
}

.trait-label {
  display: block;
  margin: 0 0 var(--space-xs);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.trait .bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.trait .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.trait-summary {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Personality & cognitive sections */
.personality-pulse {
  background: var(--bg);
}

.cognitive-strengths {
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

/* Cognitive Strengths: three modules (Pattern, Verbal, Strategic) */
.cognitive-module {
  margin-bottom: var(--space-xl);
}

.cognitive-module:last-child {
  margin-bottom: 0;
}

.cognitive-module h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.cognitive-module .bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.cognitive-module .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

.cognitive-module p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.work-style,
.growth-edges {
  background: var(--bg);
}

/* Work & Learning Style: bullet modules */
.work-style-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-style-module {
  margin-bottom: var(--space-lg);
}

.work-style-module:last-child {
  margin-bottom: 0;
}

.work-style-module h3 {
  margin: 0 0 var(--space-xs);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.work-style-module p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 42rem;
}

.share-block {
  background: var(--bg-section);
  border-top: 1px solid var(--border);
}

.pdf-teaser {
  background: var(--bg);
}

.pdf-teaser-title {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-teaser-text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Growth Edges: Strength + Watch for per dimension */
.growth-edge {
  margin-bottom: var(--space-lg);
}

.growth-edge:last-child {
  margin-bottom: 0;
}

.growth-edge h3 {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.growth-edge p {
  margin: 0 0 var(--space-xs);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.growth-edge p:last-child {
  margin-bottom: 0;
}

/* Share block */
.share-block-title {
  margin: 0 0 var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.share-summary-text {
  margin: 0 0 var(--space-md);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.share-copy-btn {
  font-family: inherit;
  cursor: pointer;
}

/* Score rows (bars) */
.results-scores {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-score-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.result-score-row:last-child {
  margin-bottom: 0;
}

.result-score-label {
  flex: 0 0 8rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.result-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.result-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.35s ease-out;
}

.result-score-pct {
  flex: 0 0 2.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
}

/* Ad slots: layout only, no tracking. Ads appear only on results page. */
.ad-slot {
  display: block;
  background: transparent;
}

/* Legacy fallback classes (if any inline refs remain) */
.quiz-results-title {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.quiz-results-intro {
  margin: 0 0 var(--space-md);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.quiz-results-modules {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.quiz-results-modules li {
  margin-bottom: var(--space-xs);
}

.placeholder-text {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.placeholder-sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.85;
  text-align: center;
}

/* Footer */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Desktop: centered layout, slightly more breathing room */
@media (min-width: 640px) {
  .hero {
    padding: var(--space-xl) var(--space-lg);
  }

  .positioning,
  .how-it-works,
  .what-you-get,
  .quiz-placeholder {
    padding: var(--space-xl) 0;
  }

  .step {
    padding: var(--space-md) var(--space-lg);
  }

  .module {
    padding: var(--space-md) var(--space-lg);
  }
}

@media (min-width: 768px) {
  :root {
    --max-width: 44rem;
  }
}
