/*--------------------------------------------------------------
# How I Build — Progressive Lifecycle Trunk Tree
# 100% Card-Free Architecture with Growing Central Trunk & Tattoos
--------------------------------------------------------------*/

.lifecycle-tree-wrapper {
  position: relative;
  width: 100%;
  padding: 30px 0 40px;
  overflow: visible !important;
}

/* ── Central Growing Trunk Line ── */
.lifecycle-trunk-line {
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 2px;
  transform: translateX(-50%);
  z-index: 1;
}

.trunk-glow-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(240, 165, 0, 0.7) 0%,
    rgba(240, 165, 0, 0.3) 30%,
    rgba(240, 165, 0, 0.4) 70%,
    rgba(240, 165, 0, 0.7) 100%);
  box-shadow: 0 0 12px rgba(240, 165, 0, 0.35);
}

.trunk-origin-root {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary, #f0a500);
  box-shadow: 0 0 14px var(--accent-primary, #f0a500);
}

.trunk-origin-root::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent-primary, #f0a500);
  animation: trunk-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.trunk-canopy-cap {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary, #f0a500);
  box-shadow: 0 0 14px var(--accent-primary, #f0a500);
}

@keyframes trunk-pulse {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Chronological Alternating Tree Nodes ── */
.lifecycle-tree-nodes {
  display: flex;
  flex-direction: column;
  gap: 44px;
  position: relative;
  z-index: 2;
  overflow: visible !important;
}

.tree-stage-row {
  display: grid;
  align-items: center;
  position: relative;
  width: 100%;
  overflow: visible !important;
  transition: transform 0.3s ease;
}

/* Left branch: Content in col 1, Limb in col 2, empty col 3 */
.tree-stage-row.stage-left {
  grid-template-columns: 1fr 64px 1fr;
}

.tree-stage-row.stage-left .tree-stage-content {
  grid-column: 1;
}

.tree-stage-row.stage-left .tree-branch-limb {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tree-stage-row.stage-left .limb-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(240, 165, 0, 0.15) 0%, rgba(240, 165, 0, 0.6) 100%);
}

/* Right branch: empty col 1, Limb in col 2, Content in col 3 */
.tree-stage-row.stage-right {
  grid-template-columns: 1fr 64px 1fr;
}

.tree-stage-row.stage-right .tree-branch-limb {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.tree-stage-row.stage-right .tree-stage-content {
  grid-column: 3;
}

.tree-stage-row.stage-right .limb-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(240, 165, 0, 0.6) 0%, rgba(240, 165, 0, 0.15) 100%);
}

/* ── Branch Limb & Connector Bud ── */
.tree-branch-limb {
  position: relative;
  width: 100%;
  height: 100%;
}

.limb-bud {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary, #f0a500);
  box-shadow: 0 0 10px rgba(240, 165, 0, 0.85);
  flex-shrink: 0;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tree-stage-row:hover .limb-bud {
  transform: scale(1.35);
  box-shadow: 0 0 16px rgba(240, 165, 0, 1);
}

/* ── Stage Content: 100% Card-Free & Open ── */
.tree-stage-content {
  position: relative;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 18px !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
}

.tree-stage-row:hover {
  transform: translateY(-2px);
}

/* ── Stage Tag ── */
.tree-stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.stage-num {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(240, 165, 0, 0.12);
  border: 1px solid rgba(240, 165, 0, 0.3);
  color: var(--accent-primary, #f0a500);
}

.stage-cat {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Stage Title & Description ── */
.tree-stage-title {
  font-family: var(--heading-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.tree-stage-row:hover .tree-stage-title {
  color: #ffffff;
}

.tree-stage-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  max-width: 500px;
  position: relative;
  z-index: 1;
}

/* ── Stage Highlights Pills ── */
.tree-stage-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  position: relative;
  z-index: 1;
}

.highlight-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.22s ease;
  cursor: default;
}

.tree-stage-row:hover .highlight-pill:hover {
  background: rgba(240, 165, 0, 0.12);
  border-color: rgba(240, 165, 0, 0.35);
  color: var(--accent-primary, #f0a500);
  transform: translateY(-1px);
}

/* ── Stage 04 QA Hub Verification Grid ── */
.tree-qa-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin: 4px 0 14px 0;
  position: relative;
  z-index: 1;
}

.qa-check-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.qa-check-item strong {
  color: var(--text-primary);
}

.tree-qa-status-note {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--accent-primary, #f0a500);
  background: rgba(240, 165, 0, 0.06);
  border: 1px solid rgba(240, 165, 0, 0.2);
  padding: 6px 14px;
  border-radius: 6px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ── Tattoo Watermark (Soft Feathered, Zero Cutoff) ── */
.tree-stage-tattoo {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.035;
  color: var(--text-primary, #ffffff);
  font-size: 135px;
  line-height: 1;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 88%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 88%);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
  transform-origin: center center;
}

.tree-stage-row:hover .tree-stage-tattoo {
  opacity: 0.14;
  color: var(--accent-primary, #f0a500);
  transform: translateY(-50%) scale(1.08) rotate(-3deg);
  filter: drop-shadow(0 0 24px rgba(240, 165, 0, 0.25));
}

/* ── Responsive Mobile & Tablet Layout ── */
@media (max-width: 991.98px) {
  .lifecycle-trunk-line {
    left: 20px;
    transform: none;
  }

  .trunk-origin-root,
  .trunk-canopy-cap {
    left: 50%;
    transform: translateX(-50%);
  }

  .lifecycle-tree-nodes {
    gap: 36px;
  }

  /* On mobile, all stages flow down the right side of the trunk */
  .tree-stage-row.stage-left,
  .tree-stage-row.stage-right {
    grid-template-columns: 40px 1fr;
  }

  .tree-stage-row.stage-left .tree-branch-limb,
  .tree-stage-row.stage-right .tree-branch-limb {
    grid-column: 1;
    justify-content: flex-start;
  }

  .tree-stage-row.stage-left .limb-line,
  .tree-stage-row.stage-right .limb-line {
    background: linear-gradient(90deg, rgba(240, 165, 0, 0.6) 0%, rgba(240, 165, 0, 0.15) 100%);
  }

  .tree-stage-row.stage-left .tree-stage-content,
  .tree-stage-row.stage-right .tree-stage-content {
    grid-column: 2;
    padding: 8px 10px !important;
  }

  .tree-qa-checklist {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tree-stage-tattoo {
    font-size: 100px;
    right: 5px;
  }
}

@media (max-width: 575.98px) {
  .tree-stage-title {
    font-size: 1.18rem;
  }

  .tree-stage-tattoo {
    font-size: 80px;
    right: 0;
  }
}

/* ── Light Mode Support ── */
html[data-theme="light"] .trunk-glow-bar {
  background: linear-gradient(180deg,
    rgba(196, 127, 0, 0.6) 0%,
    rgba(196, 127, 0, 0.25) 30%,
    rgba(196, 127, 0, 0.35) 70%,
    rgba(196, 127, 0, 0.6) 100%);
  box-shadow: 0 0 10px rgba(196, 127, 0, 0.2);
}

html[data-theme="light"] .trunk-origin-root,
html[data-theme="light"] .trunk-canopy-cap {
  background: var(--accent-primary, #c47f00);
  box-shadow: 0 0 12px var(--accent-primary, #c47f00);
}

html[data-theme="light"] .limb-bud {
  background: var(--accent-primary, #c47f00);
  box-shadow: 0 0 10px rgba(196, 127, 0, 0.6);
}

html[data-theme="light"] .stage-num {
  background: rgba(196, 127, 0, 0.1);
  border-color: rgba(196, 127, 0, 0.28);
  color: var(--accent-primary, #c47f00);
}

html[data-theme="light"] .stage-cat {
  color: #6b7280;
}

html[data-theme="light"] .tree-stage-title {
  color: #111827;
}

html[data-theme="light"] .tree-stage-desc {
  color: #4b5563;
}

html[data-theme="light"] .highlight-pill {
  background: #f8f9fa;
  border-color: #e5e7eb;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .tree-stage-row:hover .highlight-pill:hover {
  background: rgba(196, 127, 0, 0.08);
  border-color: rgba(196, 127, 0, 0.35);
  color: var(--accent-primary, #c47f00);
}

html[data-theme="light"] .tree-qa-status-note {
  background: rgba(196, 127, 0, 0.06);
  border-color: rgba(196, 127, 0, 0.22);
  color: var(--accent-primary, #c47f00);
}

html[data-theme="light"] .qa-check-item {
  color: #4b5563;
}

html[data-theme="light"] .qa-check-item strong {
  color: #111827;
}

html[data-theme="light"] .tree-stage-tattoo {
  color: #111827;
  opacity: 0.035;
}

html[data-theme="light"] .tree-stage-row:hover .tree-stage-tattoo {
  color: var(--accent-primary, #c47f00);
  opacity: 0.14;
}
