/* ── Series label ───────────────────────────────────────── */
.series-label {
  display: block;
  font-family: 'Kalam', cursive;
  font-style: italic;
  font-size: 0.82rem;
  color: #0ea5a4;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
  opacity: 0.9;
}

/* ── Join selector: 2×4 grid ────────────────────────────── */
.join-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1.4rem 0 1rem;
}

.join-btn {
  font-family: 'Kalam', cursive;
  font-size: 1rem;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 22px;
  padding: 0.5rem 0.7rem;
  background: transparent;
  cursor: pointer;
  color: #2B2B2B;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
  text-align: center;
}

.join-btn:hover {
  border-color: #0ea5a4;
  color: #0ea5a4;
}

.join-btn.active {
  background: #0ea5a4;
  border-color: #0ea5a4;
  color: #fff;
}

/* ── Content panel (fixed height = largest join) ────────── */
.join-panel {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  padding: 1.2rem 1.5rem 1.4rem;
  min-height: 560px;
  margin-top: 0.4rem;
  background: rgba(0, 0, 0, 0.015);
}

.join-panel p {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.join-panel p:last-of-type {
  margin-bottom: 0;
}

/* ── Step labels ────────────────────────────────────────── */
.join-label {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0ea5a4;
  letter-spacing: 0.03em;
  margin: 0 0 0.2rem;
}

/* ── Section spacing ────────────────────────────────────── */
.join-section-hidden {
  display: none;
}

.join-section + .join-section {
  margin-top: 1.5rem;
}

.join-hint {
  font-family: 'Kalam', cursive;
  color: #bbb;
  font-size: 0.88rem;
  font-style: italic;
  margin: 0.1rem 0;
  opacity: 0.8;
}

/* ── Word-by-word typewriter ─────────────────────────────── */
.word-ink {
  display: inline;
  opacity: 0;
  animation: wordIn 0.12s ease forwards var(--d, 0ms);
}

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

/* ── Join diagram SVG ───────────────────────────────────── */
.join-diagram {
  display: block;
  margin: 1rem 0 0.4rem;
  width: 280px;
  max-width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.join-diagram.svg-visible {
  opacity: 1;
}

/* ── Step 1: draw left circle ───────────────────────────── */
/* stroke-dasharray / stroke-dashoffset set as SVG attributes per element */
.join-diagram.svg-visible .join-c1 {
  stroke-dashoffset: 0 !important;
  transition: stroke-dashoffset 0.85s ease 0.3s;
}

/* ── Step 2: draw right circle / arrow ──────────────────── */
.join-diagram.svg-visible .join-c2 {
  stroke-dashoffset: 0 !important;
  transition: stroke-dashoffset 0.85s ease 1.25s;
}

/* ── Step 3: color the relevant area ───────────────────────*/
.join-highlight {
  opacity: 0;
}

.join-diagram.svg-visible .join-highlight {
  opacity: 1;
  transition: opacity 0.55s ease 2.2s;
}

/* ── Mobile: 2 columns ──────────────────────────────────── */
@media (max-width: 520px) {
  .join-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}
