/* =========================================================
   Mapa da Prosperidade Financeira — style.css
   Mobile-first. Custom styles only. Tailwind CDN for utilities.
   ========================================================= */

/* ── Design Tokens ── */
:root {
  --primary:            #2A6F68;
  --primary-light:      #3d8f87;
  --primary-foreground: #f5fffe;
  --primary-bg:         rgba(42,111,104,0.06);
  --primary-bg-strong:  rgba(42,111,104,0.12);

  --secondary:          #4A6fa5;
  --secondary-light:    rgba(74,111,165,0.15);

  --accent:             #D4A373;
  --accent-light:       rgba(212,163,115,0.3);

  --background:         #F4F4F0;
  --foreground:         #1e3c3a;

  --card:               #FAFAF8;
  --card-foreground:    #1e3c3a;

  --muted:              #e4eeed;
  --muted-foreground:   #5a7a78;

  --border:             #d0dedc;
  --ring:               #2A6F68;

  --radius:             0.75rem;

  --font-sans:  'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Playfair Display', ui-serif, Georgia, serif;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  /* Prevent iOS font size bump on orientation change */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  /* Double-lock overflow: both html and body */
  overflow-x: hidden;
  max-width: 100vw;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.2;
  margin: 0;
}

p { margin: 0; }

a { text-decoration: none; color: inherit; }

/* Critical: images never exceed their container */
img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
}

/* ── Container ── */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  /* Mobile: generous padding so content never touches edge */
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: min(1280px, 80vw);
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 80vw;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* ── Scroll Animation Engine ── */
.scroll-anim {
  will-change: transform, opacity;
  transition: transform 0.7s ease-out, opacity 0.7s ease-out;
}

.scroll-anim.fade-up     { transform: translateY(2.5rem); opacity: 0; }
.scroll-anim.fade-in     { opacity: 0; }
.scroll-anim.slide-left  { transform: translateX(-2.5rem); opacity: 0; }
.scroll-anim.slide-right { transform: translateX(2.5rem);  opacity: 0; }

/* On mobile, disable horizontal slide animations to prevent overflow flash */
@media (max-width: 1023px) {
  .scroll-anim.slide-left,
  .scroll-anim.slide-right {
    transform: translateY(1.5rem);
    opacity: 0;
  }
}

.scroll-anim.is-visible {
  transform: translate(0, 0) !important;
  opacity: 1 !important;
}

/* ── CTA Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 500;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(42,111,104,0.3);
  transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
  border-radius: 9999px;

  /* Mobile-first: wrap text, full width on small screens */
  font-size: 0.9375rem;
  padding: 0.875rem 1.5rem;
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
}

@media (min-width: 480px) {
  .btn-primary {
    width: auto;
    padding: 0 2rem;
    height: 3rem;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1;
  }
}

.btn-primary:hover {
  background-color: var(--primary-light);
  box-shadow: 0 6px 20px rgba(42,111,104,0.4);
  transform: translateY(-2px);
}

.btn-primary.rounded-md { border-radius: var(--radius); }

.btn-cta-final {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #fff;
  color: #4A857E;
  font-family: var(--font-sans);
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: background-color 0.3s, transform 0.3s;
  border-radius: var(--radius);

  /* Mobile-first */
  font-size: 1rem;
  padding: 1rem 1.5rem;
  width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
}

@media (min-width: 480px) {
  .btn-cta-final {
    width: auto;
    padding: 0 2.5rem;
    height: 3.5rem;
    white-space: nowrap;
    font-size: 1.125rem;
    line-height: 1;
  }
}

.btn-cta-final:hover {
  background-color: rgba(255,255,255,0.92);
  transform: scale(1.04);
}

/* ═══════════════════════════════════
   1. HERO SECTION
═══════════════════════════════════ */
#hero {
  min-height: 100svh; /* svh for mobile browsers with dynamic toolbars */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 5rem 0 3rem;
  overflow: hidden;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-badge-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--primary-bg-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-badge-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-description {
  font-size: 1rem;
  color: var(--muted-foreground);
  /* Remove fixed max-width on mobile — let it flow */
  max-width: 100%;
  line-height: 1.7;
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}

@media (min-width: 640px) {
  .hero-description {
    font-size: 1.125rem;
    max-width: 28rem;
    padding-left: 1.5rem;
  }
}

.hero-bg-right {
  position: absolute;
  top: 0; right: 0;
  width: 33%;
  height: 100%;
  background: linear-gradient(to left, rgba(74,111,165,0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero-bg-bottom {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 8rem;
  background: linear-gradient(to top, var(--background), transparent);
  z-index: 2;
  pointer-events: none;
}

/* Hero image: constrained on mobile to prevent overflow */
.hero-image-wrapper {
  position: relative;
  width: 100%;
  /* Mobile: cap at viewport width minus padding */
  max-width: min(340px, calc(100vw - 2.5rem));
  aspect-ratio: 1;
  margin: 0 auto;
}

@media (min-width: 480px)  { .hero-image-wrapper { max-width: 380px; } }
@media (min-width: 640px)  { .hero-image-wrapper { max-width: 460px; } }
@media (min-width: 768px)  { .hero-image-wrapper { max-width: 520px; } }
@media (min-width: 1024px) { .hero-image-wrapper { max-width: 640px; margin: 0; } }

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(42,111,104,0.2), rgba(212,163,115,0.2));
  border-radius: 9999px;
  filter: blur(60px);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

.hero-mandala {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 25px 50px rgba(0,0,0,0.15));
  transition: transform 2s ease-in-out;
}

.hero-mandala:hover { transform: rotate(12deg); }

/* Hero logo: ensure it doesn't overflow on mobile */
#hero .mb-8 img {
  max-width: min(280px, calc(100vw - 2.5rem));
  height: auto;
}

@media (min-width: 480px) {
  #hero .mb-8 img { max-width: 100%; }
}

/* ═══════════════════════════════════
   2. JUNG SECTION
═══════════════════════════════════ */
#jung {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
  background-color: rgba(74,111,165,0.06);
  position: relative;
}

@media (min-width: 1024px) {
  #jung { padding: 5rem 0; }
}

.jung-card {
  background-color: var(--primary-bg);
  border-radius: 1.5rem;
  padding: 1.75rem 1.5rem;
  border: 1px solid rgba(42,111,104,0.1);
  position: relative;
  /* overflow:hidden removed — causes ::before to be clipped on mobile */
}

@media (min-width: 640px) {
  .jung-card { padding: 2rem; border-radius: 2rem; }
}

@media (min-width: 1024px) {
  .jung-card { padding: 4rem; }
}

.jung-portrait-wrapper {
  position: relative;
  /* Extra padding to accommodate the rotated ::before without overflow */
  padding: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .jung-portrait-wrapper { margin-bottom: 0; }
}

.jung-portrait-wrapper::before {
  content: '';
  position: absolute;
  inset: 0; /* Changed from -1rem to 0 — no overflow */
  background-color: var(--accent-light);
  border-radius: 1rem;
  transform: rotate(3deg);
  transition: transform 0.5s ease;
}

.jung-portrait-wrapper:hover::before { transform: rotate(0deg); }

.jung-portrait {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  filter: grayscale(1);
  transition: filter 0.7s ease;
}

.jung-portrait:hover { filter: grayscale(0); }

.jung-quote {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: rgba(30,60,58,0.8);
  font-style: italic;
  border-left: 4px solid var(--accent);
  padding: 0.5rem 1.25rem;
  line-height: 1.7;
  margin: 0;
}

@media (min-width: 640px) {
  .jung-quote { font-size: 1.25rem; padding: 0.5rem 1.5rem; }
}

/* ═══════════════════════════════════
   3. ARCHETYPES SECTION
═══════════════════════════════════ */
#archetypes {
  padding: 4rem 0;
  background-color: var(--background);
}

@media (min-width: 1024px) {
  #archetypes { min-height: 100vh; padding: 6rem 0; }
}

.archetype-card {
  height: 100%;
  padding: 1.5rem;
  border-radius: 1rem;
  background-color: var(--card);
  border: 1px solid rgba(208,222,220,0.5);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.archetype-card:hover {
  border-color: rgba(42,111,104,0.3);
  box-shadow: 0 10px 30px rgba(42,111,104,0.08);
  transform: translateY(-3px);
}

.archetype-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
  transition: transform 0.3s;
}

.archetype-card:hover .archetype-icon { transform: scale(1.1); }

/* Note: pill shape only works when content is short; on mobile use rounded rect */
.archetype-note {
  display: block;
  background-color: rgba(74,111,165,0.08);
  padding: 1rem 1.5rem;
  border-radius: 1rem; /* rectangle-ish, not pill, on mobile */
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  text-align: center;
  line-height: 1.6;
  width: 100%;
}

@media (min-width: 768px) {
  .archetype-note {
    display: inline-block;
    width: auto;
    border-radius: 9999px;
  }
}

/* ═══════════════════════════════════
   4. LIGHT & SHADOW SECTION
═══════════════════════════════════ */
#light-shadow {
  display: flex;
  align-items: center;
  padding: 4rem 0;
  background-color: var(--primary);
  color: var(--primary-foreground);
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  #light-shadow { min-height: 100vh; padding: 6rem 0; }
}

.light-shadow-dots {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.ls-card {
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  height: 100%;
  transition: background-color 0.5s;
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .ls-card { padding: 2.5rem; }
}

.ls-card-light {
  background-color: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.ls-card-light:hover { background-color: rgba(255,255,255,0.16); }

.ls-card-shadow {
  background-color: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
}

.ls-card-shadow:hover { background-color: rgba(0,0,0,0.3); }

.ls-icon-wrap {
  padding: 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ls-icon-light  { background-color: rgba(255,255,255,0.2); }
.ls-icon-shadow { background-color: rgba(0,0,0,0.3); }

.ls-dot-light  { background-color: #fde047; }
.ls-dot-shadow { background-color: #9ca3af; }

.ls-quote-block {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 1.5rem 1.25rem;
  max-width: 48rem;
  margin: 3rem auto 0;
  text-align: center;
}

@media (min-width: 640px) {
  .ls-quote-block { padding: 1.5rem; }
}

/* ═══════════════════════════════════
   5. INDIVIDUATION TIMELINE SECTION
═══════════════════════════════════ */
#individuation {
  padding: 4rem 0;
  background-color: var(--background);
}

@media (min-width: 1024px) {
  #individuation { min-height: 100vh; padding: 6rem 0; }
}

/* Desktop timeline — hidden on mobile */
.timeline-desktop {
  display: none;
  position: relative;
  align-items: center;
  justify-content: space-between;
  min-height: 400px;
  margin-bottom: 5rem;
}

@media (min-width: 1024px) { .timeline-desktop { display: flex; } }

.timeline-line {
  position: absolute;
  top: 50%; left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border);
  z-index: 0;
}

.timeline-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 0 0.5rem;
}

.timeline-content.top    { bottom: calc(50% + 2rem); }
.timeline-content.bottom { top:    calc(50% + 2rem); }

.timeline-box {
  background-color: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(208,222,220,0.5);
  border-radius: 0.75rem;
  padding: 1rem;
  position: relative;
  transition: box-shadow 0.3s;
}

.timeline-box:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.timeline-box-number {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: rgba(42,111,104,0.12);
  position: absolute;
  top: -1rem; left: -0.5rem;
  line-height: 1;
  user-select: none;
}

.timeline-node {
  position: relative;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: var(--background);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

.timeline-step:hover .timeline-node { transform: scale(1.1); }

.timeline-node-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background-color: var(--primary);
}

.timeline-connector {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%;
  height: 2px;
  background-color: var(--border);
  z-index: 0;
  overflow: hidden;
}

.timeline-connector-fill {
  height: 100%;
  width: 0;
  background-color: rgba(212,163,115,0.5);
  transition: width 0.7s ease-out;
  transform-origin: left;
}

.timeline-step:hover .timeline-connector-fill { width: 100%; }

.timeline-vline {
  position: absolute;
  width: 1px;
  height: 2rem;
  background-color: rgba(208,222,220,0.5);
  transition: background-color 0.3s;
}

.timeline-vline.top    { bottom: calc(50% + 1rem); transform: translateY(100%); }
.timeline-vline.bottom { top:    calc(50% + 1rem); transform: translateY(-100%); }

.timeline-step:hover .timeline-vline { background-color: var(--accent); }

/* Mobile timeline */
.timeline-mobile {
  display: block;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
  margin-left: 0.75rem;
  margin-bottom: 3rem;
  position: relative;
}

@media (min-width: 1024px) { .timeline-mobile { display: none; } }

.timeline-mobile-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-mobile-dot {
  position: absolute;
  left: -2.5625rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: var(--background);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-mobile-inner-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--primary);
}

.timeline-mobile-card {
  background-color: var(--card);
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(208,222,220,0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden; /* clip the large ghost number */
}

@media (min-width: 480px) {
  .timeline-mobile-card { padding: 1.5rem; }
}

.timeline-mobile-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: rgba(42,111,104,0.1);
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  line-height: 1;
}

/* ═══════════════════════════════════
   7. MAP METHOD SECTION
═══════════════════════════════════ */
#map-method {
  padding: 4rem 0;
  background-color: rgba(74,111,165,0.06);
}

@media (min-width: 1024px) {
  #map-method { min-height: 100vh; padding: 6rem 0; }
}

/* Arrow flow: desktop only */
.arrow-flow {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 3rem;
}

@media (min-width: 1024px) { .arrow-flow { display: grid; } }

.arrow-segment {
  position: relative;
  height: 6rem;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-segment:first-child {
  clip-path: polygon(0% 0%, 90% 0%, 100% 50%, 90% 100%, 0% 100%);
}

.arrow-segment:not(:first-child) {
  clip-path: polygon(0% 0%, 90% 0%, 100% 50%, 90% 100%, 0% 100%, 10% 50%);
  margin-left: -1rem;
}

/* Arrow mobile: horizontal row of icons instead of vertical stack */
.arrow-mobile {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  align-items: stretch;
}

@media (min-width: 1024px) { .arrow-mobile { display: none; } }

.arrow-mobile-item {
  flex: 1;
  background-color: var(--primary);
  padding: 1.25rem 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════
   8. TARGET AUDIENCE SECTION
═══════════════════════════════════ */
#target {
  padding: 4rem 0;
  background-color: var(--background);
}

@media (min-width: 1024px) {
  #target { padding: 6rem 0; }
}

.target-card {
  background-color: var(--primary-bg);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary);
  height: 100%;
  cursor: default;
  transition: background-color 0.3s, color 0.3s;
}

@media (min-width: 640px) {
  .target-card { padding: 2rem; }
}

.target-card:hover {
  background-color: var(--primary);
  color: #fff;
}

.target-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
  transition: color 0.3s;
}

@media (min-width: 640px) {
  .target-card-title { font-size: 1.25rem; }
}

.target-card:hover .target-card-title { color: #fff; }

.target-card-desc {
  color: var(--muted-foreground);
  line-height: 1.65;
  transition: color 0.3s;
  font-size: 0.9375rem;
}

.target-card:hover .target-card-desc { color: rgba(255,255,255,0.9); }

/* Quote block: large decorative quotes adjusted for mobile */
.quote-border-block {
  border: 1px solid rgba(212,163,115,0.7);
  border-radius: 0.75rem;
  /* Top/bottom padding makes room for absolute quote marks */
  padding: 3.5rem 1.5rem 3rem;
  position: relative;
  background-color: var(--background);
  overflow: hidden; /* ensure quote marks don't escape */
}

@media (min-width: 640px) {
  .quote-border-block { padding: 3.5rem 2rem 3rem; }
}

.quote-open, .quote-close {
  position: absolute;
  font-family: var(--font-serif);
  /* Smaller on mobile so they stay within bounds */
  font-size: 3.5rem;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
}

@media (min-width: 640px) {
  .quote-open, .quote-close { font-size: 5rem; }
}

.quote-open  { top: 0.5rem;    left: 1rem; }
.quote-close { bottom: 0.5rem; right: 1rem; transform: rotate(180deg); }

/* Quote paragraph: no extra top padding since quote-border-block handles it */
.quote-border-block p {
  padding-top: 0;
}

/* ═══════════════════════════════════
   9. FINAL CTA SECTION
═══════════════════════════════════ */
#final-cta {
  padding-bottom: 3rem;
  background-color: var(--background);
}

@media (min-width: 1024px) {
  #final-cta { padding-bottom: 5rem; }
}

.cta-box {
  background-color: #4A857E;
  border-radius: 1.25rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(42,111,104,0.3);
}

@media (min-width: 640px) {
  .cta-box { padding: 3rem 2rem; border-radius: 1.5rem; }
}

@media (min-width: 1024px) {
  .cta-box { padding: 5rem; }
}

/* ── Footer ── */
footer {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .scroll-anim,
  .hero-glow,
  .hero-mandala,
  .jung-portrait-wrapper::before,
  .btn-primary,
  .btn-cta-final,
  .archetype-card,
  .timeline-connector-fill {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
