/* ============================================================
   PAGE 7 — SOULMATE QUIZ (static drawn tree)
   ============================================================ */
.page--soulmate { background: var(--soul-bg); overflow-y: auto; }
.page--soulmate .soul-title { top: 3%; z-index: 8; }
.page--soulmate .pg-title__display { font-size: clamp(24px, 9.5cqw, 40px); }
.soul-justin { position: absolute; top: 3%; right: 3%; width: clamp(80px, 26cqw, 104px); height: auto; z-index: 6; }
.soul-bubble {
  position: absolute;
  top: 40cqw;
  right: 20%;
  z-index: 6;
  background: #e9e9e9;
  border: 2px solid var(--black);
  border-radius: 14px;
  padding: 4px 8px;
  font-family: var(--f-anton);
  font-size: clamp(8px, 2.6cqw, 11px);
  text-align: center;
  line-height: 1.1;
  transform: rotate(-4deg);
}
.soul-heart { position: absolute; top: 41cqw; right: 5%; width: clamp(34px, 11cqw, 48px); height: auto; z-index: 5; }

/* tree: normal flow, sits below the title band, above the portraits */
.tree {
  position: relative;
  z-index: 5;
  margin: 55cqw 4% 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(22px, 7cqw, 32px);
}
.tree-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.tree-line {
  stroke: var(--black);
  stroke-width: 2.5;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tree-line.is-shown { opacity: 0.7; }
.tree-line.is-active {
  stroke-width: 3.5;
  opacity: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pathLength: 1;
  animation: draw-line 0.45s ease forwards;
}

.tree__start { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; width: 100%; justify-content: flex-start; }
.tree-start {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--f-anton);
  font-size: clamp(12px, 4.2cqw, 16px);
  color: var(--black);
  background: #f8a13a;
  border: 2.5px solid var(--black);
  padding: 5px 14px 5px 10px;
  clip-path: polygon(0 0, 82% 0, 100% 50%, 82% 100%, 0 100%);
}
.tree-node--q1 { flex: 0 1 auto; max-width: 66%; }
.tree-node--q {
  display: block;
  background: var(--yellow);
  border: 2.5px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  text-align: center;
  font-family: var(--f-anton);
  font-size: clamp(9px, 3cqw, 12px);
  line-height: 1.15;
}
.tree__branches { position: relative; z-index: 2; display: flex; gap: 3%; width: 100%; }
.tree__col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: clamp(20px, 6.5cqw, 28px); }
.tree-node--q2 { width: 100%; min-height: 46px; }

/* Buttons: chunky pills with a hard shadow so they read as tappable.
 * mental/social = white, yes = pink, no = black. */
.tree-branch, .tree-leaf {
  min-height: 44px;
  min-width: 78px;
  padding: 8px 16px;
  font-family: var(--f-anton);
  font-size: clamp(13px, 4.2cqw, 16px);
  letter-spacing: 0.02em;
  color: var(--black);
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--black);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease, opacity 0.25s ease;
}
.tree-leaf[data-result="chomsky"], .tree-leaf[data-result="searle"] { background: var(--pink); color: var(--white); }
.tree-leaf[data-result="saussure"], .tree-leaf[data-result="labov"] { background: var(--black); color: var(--yellow); }
.tree-branch:active, .tree-leaf:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--black); }
.tree__leaves { display: flex; gap: 10px; }

/* tap cue: choices that are available right now softly pulse */
.tree:not([data-branch]) .tree-branch,
.tree__col.is-open .tree-leaf { animation: nudge 1.6s ease-in-out infinite; }
.tree[data-result] .tree-leaf { animation: none; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 4px 0 var(--black), 0 0 0 0 rgba(255, 102, 196, 0.7); }
  50% { box-shadow: 0 4px 0 var(--black), 0 0 0 7px rgba(255, 102, 196, 0); }
}

/* progressive reveal: a column shows its question + answers only after its branch is picked */
.tree__col .tree-node--q2, .tree__col .tree__leaves { visibility: hidden; opacity: 0; transition: opacity 0.3s ease, visibility 0s 0.3s; }
.tree__col.is-open .tree-node--q2, .tree__col.is-open .tree__leaves {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
  animation: branch-in 0.45s ease both;
}
.tree__col.is-open .tree__leaves { animation-delay: 0.12s; }
@keyframes branch-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* chosen branch/answer look pressed and lit; the other side is dimmed */
.tree[data-branch="mental"] .tree__col:last-child .tree-branch,
.tree[data-branch="social"] .tree__col:first-child .tree-branch { opacity: 0.4; }
.tree-branch[aria-pressed="true"] { background: var(--yellow); transform: translateY(3px); box-shadow: 0 1px 0 var(--black); }
.tree[data-result="chomsky"] .tree-leaf[data-result="chomsky"],
.tree[data-result="saussure"] .tree-leaf[data-result="saussure"],
.tree[data-result="searle"] .tree-leaf[data-result="searle"],
.tree[data-result="labov"] .tree-leaf[data-result="labov"] { transform: translateY(3px); box-shadow: 0 1px 0 var(--black), 0 0 0 4px var(--yellow); }
.tree__result { position: relative; z-index: 5; margin: 10px 4% 0; text-align: center; font-family: var(--f-anton); font-size: clamp(13px, 4.4cqw, 17px); }
.tree__result b { color: var(--pink); -webkit-text-stroke: 0.6px var(--black); }
.tree-actions { display: flex; justify-content: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tree-link, .tree-restart {
  min-height: 44px;
  padding: 6px 14px;
  font-family: var(--f-anton);
  font-size: clamp(12px, 3.8cqw, 15px);
  border: 2.5px solid var(--black);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}
.tree-link { color: var(--white); background: var(--pink); }
.tree-restart { color: var(--black); background: var(--white); }

/* portraits with name tags — normal flow, below the tree (no overlap) */
.soul-strip {
  position: relative;
  z-index: 5;
  margin: clamp(10px, 4cqw, 20px) 3% 4%;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2%;
}
.soul-cell { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform 0.35s ease, opacity 0.35s ease; }
.soul-cell img { width: 100%; max-width: 78px; height: auto; object-fit: contain; filter: grayscale(1) contrast(1.04); }
.soul-cell__tag {
  font-family: var(--f-anton);
  font-size: clamp(10px, 3.2cqw, 13px);
  color: var(--white);
  background: var(--pink);
  border: 1.5px solid var(--black);
  padding: 1px 7px;
}
.soul-cell[data-key="saussure"] { flex-grow: 1.5; }
.soul-cell[data-key="saussure"] img { max-width: 118px; }
.soul-cell.is-match { transform: translateY(-6px) scale(1.1); }
.soul-cell.is-match img { filter: none; }
.soul-cell.is-dim { opacity: 0.35; }
